Calculating time difference between 2 dates in minutes
I think you could use TIMESTAMPDIFF(unit,datetime_expr1,datetime_expr2) something like
select * from MyTab T whereTIMESTAMPDIFF(MINUTE,T.runTime,NOW()) > 20
I am using below code for today and database date.
TIMESTAMPDIFF(MINUTE,T.runTime,NOW()) > 20
According to the documentation, the first argument can be any of the following:
MICROSECONDSECONDMINUTEHOURDAYWEEKMONTHQUARTERYEAR