Reputation: 14835
I have a field called lastlogin
in my MySQL database. It holds DATETIME
in this format: 2014-04-02 11:03:23
What is the query to call to get all records older than 90 day from today?
Upvotes: 0
Views: 10966
Reputation: 1627
You can do it as so:
SELECT * FROM table
WHERE lastLogin < DATE_SUB(NOW(), INTERVAL 90 DAY);
Upvotes: 15