title: How do I do COUNT(*) with a group by clause in db2?
body: <p>I want to know how many rows are going to be returned by this query:</p>
  
  <pre><code>SELECT 
    MONTH(DHSTMP), SUM(DHDLDY), SUM(DHBUDS), YEAR(DHSTMP) 
  FROM 
    DSHDAY 
  WHERE 
    DHSTMP BETWEEN '2009-07-26 00:00:00' AND '2011-03-09 23:59:59' 
  GROUP BY 
    YEAR(DHSTMP), MONTH(DHSTMP) ORDER BY YEAR(DHSTMP), MONTH(DHSTMP)
  </code></pre>
  
  <p>So I tried:</p>
  
  <pre><code>SELECT 
    COUNT(*) 
  FROM 
    DSHDAY 
  WHERE 
    DHSTMP BETWEEN '2009-07-26 00:00:00' AND '2011-03-09 23:59:59' 
  GROUP BY 
    YEAR(DHSTMP), MONTH(DHSTMP)
  </code></pre>
  
  <p>But it tells me how many rows for each group.</p>
  
  <p>How can I get the number of rows that will be returned for the first query?</p>