Skip to content
Advertisement

Count Males and Females Based on Categories and Group

members of Stackoverflow,I have been working with Mysql php programing for nine months ,but I have stuck while developing a small employee platform.I know it might be a duplicate question but I have been searching how to come across this without any hope
Here is my Mysql table with employees

JavaScript

I want to query this table to produce the following results. How do I come across this????

JavaScript

This is what I have tried so far

JavaScript

This produces the results for Diploma Only as follows

JavaScript

The script above gives a result in total and not showing for each center.

Advertisement

Answer

After working for couple of hours I have managed to write the following query and working well.

JavaScript

Any improvement toward my approach please welcome.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement