title: Select only unlocked rows mysql
body: <p>I have locked one row in one transaction by following query</p>
  
  <pre><code>START TRANSACTION;
  
  SELECT id FROM children WHERE id=100 FOR UPDATE;
  </code></pre>
  
  <p>And in another transaction i have  a query as below</p>
  
  <pre><code>START TRANSACTION;
  
  SELECT id FROM children WHERE id IN (98,99,100) FOR UPDATE;
  </code></pre>
  
  <p>It gives error lock wait timeout exceeded.</p>
  
  <p>Here 100 is already locked (in first transaction ) But  the ids 98,99 are not locked.Is there any possibility return records of 98,99 if only 100 is row locked in above query.So result should be as below</p>
  
  <p>Id</p>
  
  <p>===</p>
  
  <p>98</p>
  
  <p>99</p>
  
  <p>===</p>
  
  <p>Id 100 should be ignored because 100 is locked by a transaction.</p>