title: SELECT FOR UPDATE
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6593360/select-for-update-and-max">SELECT &hellip; FOR UPDATE and MAX()</a>  </p>
  </blockquote>
  
  
  
  <p>Which rows in this query lock ?</p>
  
  <pre><code>select max(id) from table where id like '9%' for update
  </code></pre>
  
  <p>what occur if another user run this query ?</p>
  
  <p><a href="https://stackoverflow.com/questions/6593360/select-for-update-and-max">this</a> is related question.</p>