frodo — 2011-07-06T13:01:33-04:00 — #1
I have a difficult question and I'm not sure it's possible to do what I have in mind, but if anyone knows s/he will be on this forum
I have a "sales" table in which each row contains the details for each sale (ie one sale = one row). The date in which the sale was made is recorded in Unix time format.
Is there a way, using only MySql, to see how many sales were made per day/week/month...?
dan_grossman — 2011-07-06T13:24:09-04:00 — #2
By "Unix time format" do you mean a Unix timestamp? Stored in an integer column?
frodo — 2011-07-06T13:37:34-04:00 — #3
Thanks for the quick reply, this is great, it's exactly what I needed. I looked at the documentation you indicated and was able to modify your query to get the same data divided by month. However I cannot seem able to get MySql to distiguish between months of different years, ie December 2010 and December 2009. Is there a way to do this?
dan_grossman — 2011-07-06T13:39:26-04:00 — #4
Group by both the month and the year. You will have a different row for 2009,12 and 2010,12.
frodo — 2011-07-06T13:43:22-04:00 — #5
Just shows I am not very good at this