SELECT WHERE difference between now and a timestamp is less than 24 hours
mysql, sql, timestamp, where-clause
Solution
SELECT
timestampdiff(HOUR, yourtimestampcolumn, now() ) as hours_since,
*
FROM
Your_table
WHERE
timestampdiff(HOUR, yourtimestampcolumn, now() ) < 24
Refer https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_timestampdiff
Problem
I want to make a MySQL selection where the difference between NOW() and a timestamp in the table is less than a specific period of time, like 24 hours. I've tried doing subtraction but it hasn't worked and DateDiff isn't what I want. There must be a simple way to do this, but I can't figure it out. Any ideas? Thanks