Results 1 to 3 of 3
Apr 8, 2011, 21:31 #1
- Join Date
- Oct 2009
- 0 Post(s)
- 0 Thread(s)
Can't understand why this SQL is wrong
There's something fundamental that I'm failing to get here. I have the following SQL query.
SELECT caseid, description, amount, SUM(amount) AS billtotal FROM billtran WHERE billtran.caseid = 2
The table has dozens and dozens and dozens of rows where the billtran.caseid equals 2, but the query returns only one row. Why? It returns the first row where billtran.caseid equals 2, but what I want is all the rows plus the amount that is the sum of all their values. What do I need to do?