title: Subquery returns more than 1 row issues with group by
body: <p>Please help resolve what is wrong with my query below I get "Subquery returns more than 1 row"</p>
  
  <pre><code>select
  count(*) NONGENACC,  AFFILIATE,
  (SELECT COUNT(ACCOUNTNO) from realdb.tbl_logs GROUP BY AFFILIATE )AS ALLACCS
  FROM  realdb.tbl_logs
  where LASTDATE &lt;&gt; CURDATE() group by AFFILIATE
  </code></pre>
  
  <p>it returns the below when i take the GROUP BY from the sub query which is not what i want in the allacs field. Kindly help...</p>
  
  <pre><code>NONGENACC AFFILIATE      ALLACCS 
  1         ECOCBFBF        1481 
  2         ECOCBIBI        1481 
  13        ECOCBJBJ        1481 
  11        ECOCCDKI        1481 
  3         ECOCCFCF        1481 
  </code></pre>