title: mySQL Update value using a max date
body: <p>I have this query, I want to be able to update the exec value to <strong>TRUE</strong> when my program finishes to execute a request and save it to my database to use it as a queue for when I have multiple executions, however, whenever I try with this query it gives me an error.</p>
  
  <pre><code>UPDATE motor 
  SET exec=1 
  where time=(SELECT max(time) 
              FROM motor 
              WHERE exec=0);
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p><em>ERROR 1093 (HY000): You can't specify target table 'motor' for update in FROM clause</em></p>
  </blockquote>
  
  <p>How can I do this? </p>