Sebastian <[EMAIL PROTECTED]> writes:

> i have this query:
>
> SELECT COUNT(*) AS score FROM downloads WHERE date_add(dateline,
> interval 1 hour) >= now() GROUP BY filename ORDER BY score DESC
>
> unfortunately for other reasons i had to change `dateline` to unix
> timestamp so this query is no longer able to run as intended. can
> anyone help with a work around?

Sure, 1 hour is just 3600 seconds, which is how Unix timestamps are
measured:

    SELECT COUNT(*) AS score FROM downloads 
    WHERE dateline + 3600 >= UNIX_TIMESTAMP() 
    GROUP BY filename ORDER BY score DESC

----ScottG.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to