There are about 90,000 rows that need to be used to get what I need. Each row has a gross_rake and room_username. There are probably 500 distinct room_username's for the whole 90,000 rows. For each distinct room_username I want to get the sum of all the gross_rake's. So if I have the room_username's TESTER, BILLY, and JOLE and 10 rows for each name, I want to return the distinct room_username plus that users total gross_rake.
This is the basic query that doesn't work but gets my point across.
Code: Select all
SELECT
DISTINCT room_username,
SUM(gross_rake)
FROM
rb_raketracking
WHERE
fk_room_id = "5"
AND
data_date LIKE "2008-03%"
In conclusion, hope you know how to do this because I don't.