I have x rows of a column value and "simply" want to add them together and update the highest row number and zero out the other values:
SELECT rowId, addCol FROM table WHERE rowId=1 OR rowId=2
rowId | addCol
1 | 100
2 | 200
3 | 67
This is kind of what I want (I know it's completely wrong) but not sure how to express it!
UPDATE table SET addCol3=addCol1+addCol2+addCol3, addCol1=0, addCol2=0
rowId | addCol
1 | 0
2 | 0
3 | 367