>I'm using MySQL 5.0. If I have a table, DAILY_SALES, with columns
This is somewhat clunky, but left(day,7) gives you the year and the month
without the day part. You can GROUP BY this. Also, I think DAY is a
keyword.
SELECT concat(left(`DAY`,7), '-01'), sum(SALES), USER_ID FROM DAILY_SALES
WHERE USER_ID = whatever GROUP BY left(`DAY`,7)
Bookmarks