title: Finding duplicate in sql with two columns
body: <p>I have records in SQL server as </p>
  
  <pre><code>c_num   c_date      invoice
  ---------------------------
   11213  2015-07-21   96914
   11213  2015-07-21   96915
  133412  2015-09-30  137389
  133412  2015-09-30  137450
  202793  2016-12-28  390045
  202793  2016-12-28  390047
     379  2016-12-15  393380
     379  2017-06-29  510412
  </code></pre>
  
  <p>I need to find <code>c_num</code> having multiple <code>c_date</code> .</p>
  
  <p>I tried below SQL, but it does not help as this table can have multiple <code>c_num</code> but every <code>c_num</code> should ideally have one <code>c_date</code>. I am trying to find c_num having multiple c_date which in this example is 379 . Expected result is 379.</p>
  
  <pre><code>select 
      c_num, c_date, count(*)  
  from 
      table_a 
  group by 
      c_num, c_date 
  having 
      count(*) &gt; 1
  </code></pre>