d
Amit DhamuSoftware Engineer
 

Get Date If After Interval

1 minute read 00000 views

Let's say we want to grab a table row in a MySQL database but only if the value in the date_added column is older than 3 months (ie. 3 months has passed since the date in the table row).

SELECT * FROM table WHERE (NOW() > date_added + INTERVAL 3 months)