I have a table
students[std_id, name, class, gender,etc]
select class,gender,count(*) as total_students
from students
group by class,gender
its output is as below
1st | male | 23
1st | female | 11
2nd | male | 17
2nd | female | 0
//the last row is not shown because 0 female students in 2nd class
how to make it shown as above with total_sudents=0 instead of skipping record.
Use this solution: