title: Why doesn't this MySQL query delete any rows?
body: <p>On the face of it, my use-case is quite simple. I have two tables: <code>order</code> and <code>line</code>. <code>order</code> contains <code>id</code> and <code>datetime</code>, and <code>line</code> has a reference to <code>id</code> in the <code>order</code> table. Unfortunately this is a very old system and I cannot (i.e. not allowed to modify the system to) use foreign keys with update/delete triggers.</p>
  
  <p>I was <a href="https://stackoverflow.com/questions/4154707/mysql-delete-from-one-table-with-join">reading this question</a> and wrote my own query to do a similar thing. Basically I want to delete all the <code>line</code>s associated with an <code>order</code> when the order is deleted, whenever that order is over two years old:</p>
  
  <pre><code>DELETE a
  FROM 
    `line` AS a
    LEFT JOIN `order` AS b ON a.`order_id` = b.`id`
  WHERE
    b.`datetime` &lt; DATE_SUB(NOW(), INTERVAL 2 YEAR);
  </code></pre>
  
  <p>Currently nothing is happening - no rows are affected. Changing the query to just select, with the same join and where clause, returns a number of results fine.</p>
  
  <p>What am I missing here?</p>