title: MySQL - Update X where Y is lowest
body: <p>I have following table:</p>
  
  <pre><code>       TableA
    x               y
  ----------------------
   3                1
   2                5
   5                2
  </code></pre>
  
  <p>Now i want to update the value in column x, where the value in column y is lowest, something like that:</p>
  
  <pre><code>UPDATE TableA SET x = 1 WHERE y = min(y);
  </code></pre>
  
  <p>Then the first row should be x = 1 and y = 1.</p>
  
  <p>But i get following error code: </p>
  
  <pre><code>Error Code: 1111. Invalid use of group function
  </code></pre>
  
  <p>How can i fix that?</p>