I have a common SQL task, but I cannot find a clear path to a solution. I have a table downloadswith columns, download_date, image_file_id, credits. What I want at the end is the part, plus the subtotal creditsfor the day at the end of each day. For instance.
2010-10-06 123456 5
2010-10-06 234567 20
25
2010-10-07 234678 15
etc.
I can use SUM()it GROUP BYto get daily subtotals, but I’d like a convenient way to get a result set containing both in the correct order, so I don’t need to scan the data again in client code to organize the subtotals with lowercase strings.
source
share