Sql: Select Sum Of Each Individual Value Of A Column
There is a column that can have several values. I want to select a count of how many times each distinct value occurs in the entire set. I feel like there's probably an obvious sol
Solution 1:
SELECTCLASS, COUNT (*)
FROM MYTABLE
GROUPBYCLASS
Solution 2:
selectclass, count(1)
from table
groupbyclass
Solution 3:
Make Count as column
selectclass, count(1) as Count
from table
groupbyclass
Solution 4:
Please try this
SELECTclass , count( class ) AS COUNT FROM `tble` GROUPBYclass
Post a Comment for "Sql: Select Sum Of Each Individual Value Of A Column"