title: sql delete all rows older than 30 days
body: <p>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</p>
  
  <p>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?</p>
  
  <pre><code>DELETE FROM messages WHERE sentOn &lt; '2018-02-21 00:00:00';
  </code></pre>
  
  <p>would this work?</p>
  
  <p>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</p>