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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -