Here's a problem that I thought would be simple, but I can't seem to get it to work.......I've got a temporary table with 2 columns. The first column is Job Code, the second column is Hours billed to that Job Code. There are only 8 different Job Codes, but my table has about 900 rows. I simply want to eliminate all the duplicate Job Code entries, rolling them into one row while summing up all the hours billed to the individual Job Code in question.....however, with my SQL (seen below), I still get 900 rows back. I'd expect to get 8 rows, with all the Hours summed up for each individual Job Code.....I don't understand why I can't get this to work.....any ideas?:
SELECT DISTINCT
Job_Code, SUM(Hours)
FROM
#Temp_Table7
GROUP BY Job_Code, Hours
SELECT DISTINCT
Job_Code, SUM(Hours)
FROM
#Temp_Table7
GROUP BY Job_Code, Hours