Please bear with me, as I have very little SQL knowledge.
Basically, I would like to be able to generate a list of totals from a table that holds data for various locations. Within the table, each row references the location’s ID and has a value:
ID LocationID Value
___ ____________ _______
1 11 500
2 11 400
3 12 500
4 12 600
5 12 300
6 13 400
7 13 500
I would like to produce a list with each locationID and the total of all values within the “data” table.
Desired output:
LocationID Total
__________ _____
11 900
12 1400
13 900
I am sorry if I have explained it poorly… Like I said, I have very limited knowledge of SQL so I simply do not know where to start. If somebody could simply point me in the correct direction I would be very grateful.
Try below:
I am assuming
datais your table name andLocationIDandvalueare column names.