Reputation: 606
I want to delete some data from database:
WHERE created_at < NOW() - 30 min
How to wirte the 30 min into sql
Upvotes: 0
Views: 643
Reputation: 28713
Calculate older date and compare with it:
WHERE created_at < NOW() - INTERVAL 30 MINUTE
See DATE_ADD
description for list of all available units.
Upvotes: 4