0

I want to delete some data from database:

WHERE created_at < NOW() - 30 min

How to wirte the 30 min into sql

2 Answers 2

4

Calculate older date and compare with it:

WHERE created_at < NOW() - INTERVAL 30 MINUTE

See DATE_ADD description for list of all available units.

Sign up to request clarification or add additional context in comments.

Comments

1
WHERE created_at < NOW() - INTERVAL 30 MINUTE;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.