Hello Everyone,
First I would like to thank you to anyone that give an answer to my question.
I have a table like this one below (KeyID is auto-increment)...
I can't figure out the syntax to query the table to sum all the "Amount"s and exclude older records for like UserIDs.
Here is what I have....
SELECT SUM(Amount) as Total FROM Table
Total = 15 (Should be 9)
Thanks again.
First I would like to thank you to anyone that give an answer to my question.
I have a table like this one below (KeyID is auto-increment)...
Code:
KeyID UserID Amount 1 12 1.00 2 09 1.00 3 12 5.00 4 12 6.00 5 10 2.00
Code:
KeyID UserID Amount 1 12 1.00 <---exclude 2 09 1.00 3 12 5.00 <---exclude 4 12 6.00 5 10 2.00
SELECT SUM(Amount) as Total FROM Table
Total = 15 (Should be 9)
Thanks again.
Comment