sql - MySQL. Issue with: INTERVAL 60 MINUTES + last_run < NOW() -


i attempting select row database based on time value.

my database contains table of actions. these actions run ever x number of minutes. when action ran, row updated , it's last_run column timestamp containing value of now()

here valid row in database. can see row last run days ago. it's set run every 60 minutes.

enter image description here

i use interval last_run + interval_minutes < now(). so, last run time, plus sixty minutes, less value of now() if 60 minutes has passed.

the query trying run below:

select     *     routine_actions     routine_actions.routine_id = 12 ,      interval routine_actions.interval_minutes minute + routine_actions.last_run < now() group routine_id 

but, i'm getting no results. idea's doing wrong?

the query you're trying looks ok in first part of question, following

interval last_run + interval_minutes minutes < now()  

should be

interval interval_minutes minutes + last_run < now()  

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -