title: MySQL Error 1093 - Can't specify target table for update in FROM clause
body: <p>I have a table <code>story_category</code> in my database with corrupt entries. The next query returns the corrupt entries:</p>
  
  <pre><code>SELECT * 
  FROM  story_category 
  WHERE category_id NOT IN (
      SELECT DISTINCT category.id 
      FROM category INNER JOIN 
         story_category ON category_id=category.id);
  </code></pre>
  
  <p>I tried to delete them executing:</p>
  
  <pre><code>DELETE FROM story_category 
  WHERE category_id NOT IN (
      SELECT DISTINCT category.id 
      FROM category 
        INNER JOIN story_category ON category_id=category.id);
  </code></pre>
  
  <p>But I get the next error: </p>
  
  <blockquote>
    <p>#1093 - You can't specify target table 'story_category' for update in FROM clause </p>
  </blockquote>
  
  <p>How can I overcome this?</p>