Delete all new records in SQL created in the past few minutes

DELETE FROM tablename where tablename.id IN(SELECT id FROM tablename WHERE "created_on" >=NOW() - INTERVAL '10 minutes');

Leave a Reply

Your email address will not be published. Required fields are marked *