title: Update mysql table where select from same table
body: <p>I am new to MYSQL query statements and i am currently stuck at some piece of code as following
  <br></p>
  
  <pre><code>UPDATE fb_messages
  SET sent = 'Yes' 
  WHERE msg_id = (SELECT MAX(msg_id) AS MSG_ID 
                  FROM fb_messages
                  WHERE sent = 'No')
  </code></pre>
  
  <p>I am getting this error</p>
  
  <pre><code>#1093 - You can't specify target table 'fb_messages' for update in FROM clause
  </code></pre>
  
  <p>I searched for a solution to work around for similar cases but i really couldn't find, please help </p>