I have a column called "status" in a sql table called "latest" which contains five different values new,deployed,resolved,assigned and closed as shown below
Status
--------------
NEW
NEW
DEPLOYED
NEW
RESOLVED
ASSIGNED
ASSIGNED
RESOLVED
ASSIGNED
NEW
NEW
RESOLVED
CLOSED
ASSIGNED
I want to write a query in which i can count the number of times each of these words occur in the column "status". Currently I'm using count function in 5 different queries like this.
1)select count(status) from latest where status="NEW";
2)select count(status) from latest where status="DEPLOYED";
3)select count(status) from latest where status="RESOLVED";
4)select count(status) from latest where status="ASSIGNED";
5)select count(status) from latest where status="CLOSED";
Is there a way i could combine all these queries into single query without using joins or union to get 5 different count values??