title: Mysql- update mulitiple columns from select with group by
body: <p>I have a table and I need to update it using a select from another table.</p>
  
  <p>What I had in mind:</p>
  
  <pre><code>UPDATE articles, 
      (SELECT  count(*) AS count FROM nots WHERE otherID=243 GROUP BY number) AS cnots 
  SET articles.first=(SELECT count FROM cnots WHERE number=1),
      articles.second=(SELECT count FROM cnots WHERE number=2),
      articles.third=(SELECT count FROM cnots WHERE number=3)
  WHERE articles.ID=243
  </code></pre>
  
  <p>The query throws an error "Table 'mydb.cnots' doesn't exist".</p>
  
  <p>I can do it with 3 different selects,  but I don't want to, any ideas?</p>