I have a table with the name of attendance with 2 attributes (id, comments). I want to display the absence account or be late for one identifier from the attendance table.
Attendance Table |ID | Remarks | ============================= |1 | Absent | |1 | Late | |2 | Absent | |2 | Absent | |3 | Late | Sample Output |ID | Absent | Late | ================================== |1 | 1 | 1 | |2 | 2 | | |3 | | 1 |
currently I can only output 2 columns (ID and Missing) or (ID and Late) with this code:
SELECT id, count(remarks) AS Absent FROM attendance WHERE remarks = 'Absent' GROUP BY id;
I cannot display the missing and late column at the same time .. please help. thanks.
source share