Lee Lee
Lee Lee

Reputation: 583

MySQL: Delete all rows older than 20 Hours

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)

Question: Is above query is correct?

Upvotes: 4

Views: 5540

Answers (1)

iceraj
iceraj

Reputation: 359

Yes, your delete query is correct.

Upvotes: 3

Related Questions