Well, I need to group the results first, then sum up the column, not capture the sum of the table.
There are multiple IDs in the table that aren't unique.
ID|Cost
1|1.00
2|2.00
1|1.00
I want to group the IDs which will result in
ID|Cost
1|1.00
2|2.00
Now, what I want to do is sum up the Cost column which should result in 3.00.
The problem I'm getting is that it's suming up all groups:
ID|Cost
1|2.00
2|2.00
That is not what I want, so I'm hoping there is a SQL way around this. Otherwise, I'm running through each row with PHP and adding the total one by one which is quite slow when there are expected to have thousands of IDs. . .