Home > database >  The oracle database problems
The oracle database problems

Time:10-10

In the database customers employees gender to count
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 Gender

CodePudding user response:

 SELECT Gender, count (1) the FROM TB 
GROUP BY Gender.
  • Related