title: Combine Update and Select Query
body: <p>I got two MySQL working fine and i'm trying to find a way to combine them into one single query.</p>
  
  <p>First, it selects ID of an employee.</p>
  
  <pre><code>SELECT 'ID' FROM `employee` ORDER BY ID DESC LIMIT 1;
  </code></pre>
  
  <p>Let's say it returns ID 100;</p>
  
  <p>Then update data of employees whose ID is 100 </p>
  
  <pre><code>UPDATE 'LOG' SET `TIME_EXIT`='2013/02/22' WHERE `ID`='100';
  </code></pre>
  
  <p>Can i do it all in a single query?</p>