I’m using SQL Server 2008 and I have a table that has a ‘Status’ column in it. There are five possible statuses: Submitted, In Progress, Deleted, Implemented, Not Implemented.
I’m trying to figure out to write a SQL Statement that will return the count of each of these statuses but my code is either returning the number statuses, or the count of a specific status. Here’s what I was working with:
SELECT COUNT(ServiceAreaID) AS ServiceArea
FROM Suggestions
WHERE (ServiceAreaID = 6)
or this one
SELECT COUNT(DISTINCT ServiceAreaID) AS ServiceArea
FROM Suggestions
For one:
For all: