Inquire what should use output statements to achieve the following format:
Gender Count
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Male: XXX
Female: XXX
CodePudding user response:

Table structure to stick out, usually with a group by it
CodePudding user response:
Only gender and values in the table is M (male) and F (female), ask how to statistics the number of men and women both then can also output format?CodePudding user response:
The select Gender, count (1) the from your table group by GenderCodePudding user response:
SELECT Gender, count (1) the FROM TB
GROUP BY Gender.