How to get the count of each distinct value in a column? [duplicate] How to get the count of each distinct value in a column? [duplicate] sql sql

How to get the count of each distinct value in a column? [duplicate]


SELECT  category,  COUNT(*) AS `num`FROM  postsGROUP BY  category