title: MYSQL update with WHERE SELECT subquery error
body: <p>I have an issue with getting select sub-queries to work on an <code>UPDATE</code>. I'm trying something like the following:</p>
  
  <pre><code>UPDATE foo
     SET bar=bar-1
   WHERE baz=
        (
         SELECT baz
         FROM foo
         WHERE fooID='1'
        )
  </code></pre>
  
  <p>Where <code>foo</code> is the table name with primary key <code>fooID</code>. <code>bar</code> and <code>baz</code> are of type INT. When executing this I get the following error:</p>
  
  <pre><code>Error: A query failed. You can't specify target table 'foo' for update 
  in FROM clause
  </code></pre>