SQL Count non existing item
问题 I have table Groups, ID NUMBER STATUS VARCHAR2(20 BYTE) I am able to count the number of status as following. select g.status, count(*) from groups g group by g.status; STATUS COUNT(*) -------------------- ---------- OK 2 NOK 1 I have another status ,say PENDING, REJECTED. But there is no item exists in table, but I want them to be shown with zero count as following. STATUS COUNT(*) -------------------- ---------- OK 2 NOK 1 PENDING 0 REJECTED 0 What will be the SQL statement to make it