This may be a Q: for the database forums, but I will try here first.
I am attempting to retrieve all DISTINCT rows from a timestamp column in a table. The timestamp column (time) is in YYYY:MM😃D:HH:MM:SS format. When I try to query the db to find distinct DAYS I get multiple results based on the time portion of the row. Basically, I want the query to ignore the time portion all together. Example:
$sstats_query = mysql_query("SELECT DISTINCT time, DATE_FORMAT(time,'%d') as formatted_date FROM $db_table ORDER BY time ASC");
It would be great if somehow I could do the DATE_FORMAT before DISTINCT. Anyone have any ideas?
Thanks!