I would like to delete all rows from the database that is older than 1 month. How can I do that in Drupal 8?
DELETE FROM myTable WHERE MyColumn < DATEADD(MONTH, -1, GETDATE())
You can do it by using this code
$query = \Drupal::database()->delete('table');
$query->condition('some column', 'some condition');
$query->execute();