There are a lot of questions on how to delete all rows older than 30 days but i can't find anything same with mine so i can fix it
i need to delete some records of messages that are older than 30 days, the column name with the date is named sentOn and the rows in that column looks like this 2018-01-12 12:25:00 How should i format my query to delete all records from the table containing those that are older than 30 days?
DELETE FROM messages WHERE sentOn < '2018-02-21 00:00:00';
would this work?
EDIT: above query works but very very slowly any way to make it faster? i tried now() but it gives error that the function is wrong