I have a table called DollarTransactions in a database, which records purchases. The table has the following fields, which you can see by clicking the link to a screenshot:
I need to write 3 queries using these fields:
1) Total Cents for each day in the month of March 2013. Revenue is measured with the "cents" field.
2) Total Cents per hour for each day in March 2013
3) User ID of the user who spent the most Cents in December 2012?
I was working on a query for #1 that went like this:
SELECT trunc(createdDate, 'HH') "Hour", sum(cents)
WHERE createdDate BETWEEN '2013-03-01' AND '2013-03-31'
GROUP BY trunc(createdDate, 'HH')
But I don't know if that's right, and I'm lost on the other queries. Any help would be really appreciated!