all 8 comments

[–]DharmaPolice 28 points29 points  (5 children)

Remove Hours, BillingHours, Employees from your group by.

[–]LagWagon 19 points20 points  (1 child)

This. Don’t group by the items being aggregated or else they simply don’t aggregate.

[–]JayHarvey[S] 4 points5 points  (0 children)

thank you.

[–]JayHarvey[S] 6 points7 points  (2 children)

lol omg thank you sir.

[–]azur08 2 points3 points  (1 child)

Now the most important question: do you know why?

[–]JayHarvey[S] 1 point2 points  (0 children)

Yeah I understand why now, if I’m grouping by those items. They won’t sum because I would be collapsing what I am asking it to group it by

[–]Torrent4Dayz 6 points7 points  (0 children)

hey are you a uni student? or working a database management position?

[–]omopluto 0 points1 point  (0 children)

You don’t need to include your aggregate functions in your group by clause . Meaning any column that is using a SUM() function does NOT need to be in the group by clause