我喜歡這張我對集團明智摘要SQL代碼
Attendance
----------
Studentid | Date | Status
--------------------------------
1 | 2017-01-01 | Present
1 | 2017-01-02 | Present
1 | 2017-01-03 | Absent
1 | 2017-01-04 | Presnt
2 | 2017-01-01 | Absent
2 | 2017-01-02 | Present
2 | 2017-01-03 | Absent
2 | 2017-01-04 | Presnt
我想寫一個MySQL查詢得到這樣的輸出。
StudentID | PresentCount | AbsentCount
1 | 3 | 1
2 | 2 | 2