title: SQL Query Error #1093 - Can't specify target table 'a' for update in FROM clause
body: <p>In my WordPress DB I am executing a version of this more simplified query:</p>
  
  <pre><code>    UPDATE wp_postmeta a
      SET    a.meta_value = 'roses'
      WHERE  a.meta_key = 'flowers' AND
             EXISTS (SELECT *
                     FROM   wp_postmeta b
                     WHERE  a.post_id = b.post_id AND 
                            b.meta_key = 'month' AND 
                            b.meta_value = 'august')
  </code></pre>
  
  <p>I keep getting the following error:</p>
  
  <pre><code>   #1093 - You can't specify target table 'a' for update in FROM clause 
  </code></pre>
  
  <p>I have limited experience in working with DB queries to understand how to fix the query.</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>UPDATE #1:  The answer was provided below by @Rahul.</p>