Q:

count items inside each of distinct status

Table abc - suppose there are three columns: id, title and status
select distinct status from abc; 

Result:  
home
archive
wait
aauth
impress

select count(distinct status) from abc;  

Result: 5 
What I need is to count items inside each distinct status:  
home       10
archive    14
wait       17
aauth      19
impress    27

Any help?

A:

Try using GROUP BY:
SELECT status, COUNT(*) FROM abc GROUP BY status;

