I've got a table that has a timestamp column. I'm trying to group the data by month and year. This is the query I am using:
SELECT FROM_UNIXTIME( week, '%Y %m' ) AS time, store, sales FROM sales_tracking GROUP BY time, store;
There is actually only one timestamp per day, as this is taking daily data tallies.
The problem is, the output I get is only the data for the first timestamp of each month. So in other words, the data is for the first day of each month.
I've tried working this a number of ways, but I can't seem to get the right output. Is there something about grouping with the FROM_UNIXTIME value that is the problem?