title: SQL - Counting Records By Group
body: <p>I would like my results to include records only where there is more than Tag Date per Debt Number.</p>
  
  <pre><code>SELECT DISTINCT
      tag.tag_shrt_nm AS [Tag]
      ,cnsmr.cnsmr_idntfr_agncy_id AS [Borrower Number]
      ,CAST(cnsmr_pymnt_tag.cnsmr_pymnt_tag_assgn_dt AS Date) AS [Tag Date]
      ,cnsmr_accnt_idntfr_agncy_id [Debt Number]
  FROM         
      cnsmr INNER JOIN
      cnsmr_pymnt_jrnl ON cnsmr.cnsmr_id = cnsmr_pymnt_jrnl.cnsmr_id INNER JOIN
      cnsmr_pymnt_tag ON cnsmr_pymnt_jrnl.cnsmr_pymnt_jrnl_id =  cnsmr_pymnt_tag.cnsmr_pymnt_jrnl_id INNER JOIN
      tag ON cnsmr_pymnt_tag.tag_id = tag.tag_id INNER JOIN
      cnsmr_accnt ON cnsmr.cnsmr_id = cnsmr_accnt.cnsmr_id
  WHERE     
      tag.tag_shrt_nm IN ('tRehab')
  ORDER BY 
      cnsmr_accnt_idntfr_agncy_id
  </code></pre>
  
  <p>Here there is more than 1 date per debt number so this is my desired output.</p>
  
  <pre><code>Tag         Borrower Number     Tag Date        Debt Number
  tRehab      1000020234          2012-02-20      1089484
  tRehab      1000020234          2012-04-07      1089484
  tRehab      1000020234          2012-04-10      1089484
  tRehab      1000020234          2012-02-20      1089487
  tRehab      1000020234          2012-04-07      1089487
  tRehab      1000020234          2012-04-10      1089487
  </code></pre>
  
  <p>Here there is only 1 debt number per tag date so this not what I'm looking for and should not be in the results.</p>
  
  <pre><code>Tag         Borrower Number     Tag Date        Debt Number
  tRehab      1000020234          2012-02-19      1089484
  tRehab      1000020234          2012-04-07      1089485
  tRehab      1000020234          2012-04-10      1089486
  tRehab      1000020234          2012-02-20      1089487
  tRehab      1000020234          2012-04-07      1089488
  tRehab      1000020234          2012-04-10      1089489
  </code></pre>