title: SELECT query in WHERE clause of UPDATE query
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/45494/mysql-error-1093-cant-specify-target-table-for-update-in-from-clause">Mysql error 1093 - Can’t specify target table for update in FROM clause</a>  </p>
  </blockquote>
  
  
  
  <p>I am getting an error when putting SELECT query in WHERE clause of UPDATE query.</p>
  
  <p>my Query is like this :</p>
  
  <pre><code>UPDATE `subschedulesseats` m
  SET m.studentid='1'
  WHERE m.`seatid`= (
      SELECT h.`seatid`
      FROM `subschedulesseats` h
      WHERE h.`sessiontime`='02:30~04:00'
      ORDER BY h.`seatid` ASC
      LIMIT 2,1
  )
  </code></pre>
  
  <p>AND Error will be shown is like this :</p>
  
  <p>"You can't specify target table 'm' for update in FROM clause"</p>
  
  <p>I have attached a snap shot of the error display.</p>
  
  <p><img src="https://i.stack.imgur.com/XRbBk.png" alt="enter image description here"></p>
  
  <p>Please anyone can help me in this problem?</p>
  
  <p>Thank You in Advance</p>