title: SQL MIN() as subquery - "group function not allowed"
body: <p>I'm trying to select a value which corresponds to the lowest number in another column, and then use it to SET in another table.</p>
  
  <p>But it's telling me "group function is not allowed here"</p>
  
  <p>is there any other way to accomplish this? </p>
  
  <pre><code>UPDATE team 
  SET OWNERID = (SELECT USERID
           FROM teamuser
           WHERE MIN(CREATETIME) 
           AND teamId = 5) 
  WHERE teamId = 5
  </code></pre>
  
  <p>(Both team and teamuser tables have a column teamId).</p>