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

sql server - Deadlock occuring in Clustered Columnstore index -

python - What's the Pythonic way to report nonfatal errors in a parser? -

angular - Converting AngularJS deffered promise to AngularX observable for JSOM -