Home > database >  Classification statistics, and contains a count of 0
Classification statistics, and contains a count of 0

Time:10-13

The table below
No type
1 a
2 a
3 a
4 b
5 c
6 e
7 e


Want to get the results as follows
Type frequence
A 3
B 1
C 1
D 0
E 2

CodePudding user response:

Select the type, the COUNT (type) from biao GROUP BY type

D,,,

CodePudding user response:

You this should be impossible, as long as in the database would not seen at least one time that the result of the group will not have it, or say, you have all types
  • Related