I have a table named – studentId_t
which is having fields:
- SrNo.
- classId
- StudentId
- StudentName
- Status
- Creation Date
- Modified Date
and another table named studentE
which is having fields
- SrNo.
- classId
- studentId
- studentAdd
- EId
—
I want to check status of student and I am having only E_id
I was trying query like ..
SELECT COUNT(1) AS ST FROM `StuInfo`.`studentId_t` S, `StuInfo`.`studentE` SE
WHERE S.`status` = 'ST'
AND SE.`studentId` = S.`studentId`
AND SE.`EId` = 1
but here, I want to calculate status in (ST, BS, BH, GN), So how can i calculate it in single query from above query I am able to calculate single status, I want multiple status
USE
SUM()withif,elseconditions oriented to all status.Try like below: