mysql - My SQL Code for Group wise Summary -


my table this

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 

i want write mysql query output this.

studentid | presentcount  | absentcount 1         |       3       |     1 2         |       2       |     2 

select studentid, date,status attendance studentid=1

select studentid, date,status attendance studentid=2


Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -