[thelist] mySQL- how to test if table contains data

Ben Phillips ben at inchima.com
Wed Feb 6 08:15:00 CST 2002


> > Would it be possible to "GROUP BY " day, when the date-format is in
> > Unix-time (sec since 1970) ?
>
> you can do this:
>
> select ... ,TO_DAYS(timestamp) as date_day where ... group by date_day
>
> i think? i know that works with a mysql timestamp - don't know if it works
> with a unix timestamp... can anyone clarify?

just checked at mysql.com/doc/, if it is a unix timestamp do the following:

select ... ,TO_DAYS(FROM_UNIXTIME(timestamp)) as date_day where ... group by
date_day

hope this helps.

benji.




More information about the thelist mailing list