- Where Developers Learn, Share, & Build Careers
Can datetime fields compare with mySQL and return time difference with the current date? I really do not know where to start from, if someone has any ideas, then tell me in the right direction.
Here's what I've tried before.
SELECT * FROM `order` where 'datetime adoid' - now () Basically what I am trying to get is to get the order that is saved in the database for more than 8 hours. Thanks!
If you want your query to have an opportunity to use an index in the Timetable column, You should not manipulate the column, but only on the other side:
'order' from 'SELECT' where date was added & lt; Now () - Interval 8 hours;
Comments
Post a Comment