I've got a table in a mysql database that contains monetary transactions. Let's say the tabled is called transactions:
id int,
to_user int,
from_user int,
created datetime,
amount double
I'm trying to create a query that returns the average amount of a transaction grouped by the number of transactions that appear per day. The applicable columns are amount and created.
So I'm trying to answer the question: what is the average amount of transactions that occur on days where there are between 0 and 2 transactions, between 2 and 4 transactions, between 4 and 6 transactions, etc.
Any ideas?