Reputation: 583
I have a timestamp field in my table. How do I delete records older than 20 hours old?
My query is : DELETE FROM tickets WHERE timestamp < (NOW() - INTERVAL 20 HOUR)
DELETE FROM tickets WHERE timestamp < (NOW() - INTERVAL 20 HOUR)
Question: Is above query is correct?
Upvotes: 4
Views: 5540
Reputation: 359
Yes, your delete query is correct.
delete
Upvotes: 3