You need to convert the timestamp to a date, in both the select
and group by
clauses. In MySQL, the easiest way to do this is with the date()
function:
SELECT count(Timestamp) as COUNT, date(Timestamp)
FROM MyDatabase
WHERE EVENTS = 'FIRST'
GROUP BY date(Timestamp)
If you very specifically want that format of date, you can also use date_format()
:
SELECT count(Timestamp) as COUNT, date_format(Timestamp, '%Y-%m-%d')
FROM MyDatabase
WHERE EVENTS = 'FIRST'
GROUP BY date_format(Timestamp, '%Y-%m-%d')