I need to find out all statuses in a table using group by:
SELECT status FROM table GROUP BY status
And then count the results found
Just group by status this will give you desired result
select status, count(id) as COUNT FROM table GROUP BY status
Use below query:
SELECT status, count(id) as CNT FROM table GROUP BY status