title: how to find duplicate element with multiple fields
body: <p>I have scenario where in a table contains 2 columns.
  product and sub like </p>
  
  <pre><code>Sno    Product  Sub
  1      pr1      sub1 
  2      pr1      sub1 
  3      pr2      sub1 
  4      pr2      sub1 
  5      pr3      sub2
  6      pr4      sub3
  7      pr5      sub3
  8      pr6      sub4
  9      pr6      sub4
  </code></pre>
  
  <p>I want to find element which have col <strong>sub</strong> assigned to col <strong>product</strong> more than 1.But diff product not same.</p>
  
  <p>so my result will be <strong>sub1</strong>,<strong>sub3</strong>
  expected result will be distinct :</p>
  
  <pre><code>    Sub
   1  sub1
   2  sub3
  </code></pre>
  
  <p>I tried using group by on product and sub something like :</p>
  
  <pre><code>SELECT
      product,
      sub,
      COUNT(*)
  FROM table1
  GROUP BY
      product,
      sub
  HAVING COUNT(*) &gt; 1;
  </code></pre>
  
  <p>but this is not correct for the given scenario .
  Need your advice on this.</p>