title: Get around self-referencing in a DELETE query
body: <p>I'm trying to delete all records which aren't the latest version under their name but apparently you can't reference access a table you are modifying in the same query. </p>
  
  <p>I tried this but it doesn't work for the reasons above:</p>
  
  <pre><code>DELETE FROM table
  WHERE CONCAT(name, version ) NOT IN (
  SELECT CONCAT( name, MAX( version ) )
  FROM table
  GROUP name
  )
  </code></pre>
  
  <p>How can I get around this?</p>
  
  <p>Cheers</p>