I’ve a MySQL table that has various values per user and per day, but the created is an INT with unix timestamp:
id INT, AUTO_INCREMENT
users_id INT
value INT
created INT
I need to select maximum one value per day and per user, for the last 30 days. If it was a MySQL TIMESTAMP I would do something like: SELECT * FROM table GROUP BY DAY(created) but I can’t do it with a UNIX timestamp.
Any idea on how I can reproduce a similar query with the current data?
Something like that (widely burned, but) : don’t group by day only, in last 30 days, you might have two times the same day (February…)