How can I delete a row from the database? 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 &lt; DATEADD(MONTH, -1, GETDATE())
You can do it by using this code

$query = \Drupal::database()-&gt;delete('table');
$query-&gt;condition('some column', 'some condition');
$query-&gt;execute();