title: error : #1242 - Subquery returns more than 1 row
body: <p>I got an error: #1242 - Subquery returns more than 1 row when i run this sql.</p>
  
  <pre><code>CREATE VIEW test 
  AS 
    SELECT cc_name, 
           COUNT() AS total, 
           (SELECT COUNT(*) 
              FROM bed 
             WHERE respatient_id &gt; 0 
          GROUP BY cc_name) AS occupied_beds, 
           (SELECT COUNT(*) 
              FROM bed 
             WHERE respatient_id IS NULL 
          GROUP BY cc_name) AS free_beds 
      FROM bed 
  GROUP BY cc_name; 
  </code></pre>