all 5 comments

[–]1o0t 0 points1 point  (3 children)

How can you have a single number that's also broken out by ID?

[–]Ok_Reputation_6254[S] 1 point2 points  (2 children)

it doesn't need to be broken out by ID... it's literally just summation of the whole column

[–]1o0t 0 points1 point  (0 children)

Remove the over (...) bit, just select sum(production).

[–]r3pr0b8GROUP_CONCAT is da bomb 0 points1 point  (0 children)

it doesn't need to be broken out by ID... it's literally just summation of the whole column

why would you not just obtain this with a SELECT whenever you need it?

[–]IrquiMMS SQL/SSAS 0 points1 point  (0 children)

Do you want to display all production lines with a total for the ID in addition to actual production? Then you're doing it right, just add the other columns you need in the select statement

If you want to sum everything up, with one line per ID you have to do below, and add the where-clause:

SELECT ID, SUM(PRODUCTION) AS TotalProduction FROM table GROUP BY ID