This SQL statement
SELECT `ip`, `when` FROM `metrics` WHERE `vidID` = '1' GROUP BY DATE('when')
returns one result, even though multiple are present in the table with different dates. I’ve tried using DATE_FORMAT as well. Am I doing something stupid?
When is a timestamp column with full timestamp, including hours, minutes and seconds. I’m trying to just group by results by day/month/year.
Looks like you’re grouping by the constant string
'when'instead of the fieldwhen.Use this instead:
Sounds like you want to count the IP addresses for a given date: