In SQL Server 2005 I have a table cm_production that lists all the code that's been put into production. The table has a ticket_number, program_type, and program_name and push_number along with some other columns.
GOAL: Count all the DISTINCT program names by program type and push number
What I have so far is:
DECLARE @push_number INT;
SET @push_number = [HERE_ADD_NUMBER];
SELECT DISTINCT COUNT(*) AS Count, program_type AS [Type]
FROM cm_production
WHERE push_number=@push_number
GROUP BY program_type
This gets me started there, but it's including all the program names, not the different ones (which I don't expect it to do in that query). I guess I just can't cover my head around how to tell it to count only the distinct program names without choosing them. Or something.