title: Identify duplicates rows based on multiple columns
body: <p>@SQL Experts,</p>
  
  <p>I am trying to fetch duplicate records from SQL table where 1st Column and 2nd Column values are same but 3rd column values should be different. </p>
  
  <p>Below is my table</p>
  
  <pre><code>ID    NAME     DEPT    
  --------------------
  1     VRK      CSE
  1     VRK      ECE
  2     AME      MEC
  3     BMS      CVL
  </code></pre>
  
  <p>From the above table , i am trying to fetch first 2 rows, below is the Query, suggest me why isn't give correct results.</p>
  
  <pre><code>SELECT A.ID, A.NAME, A.DEPT 
  FROM TBL A
  INNER JOIN TBL B ON A.ID = B.ID
                   AND A.NAME = B.NAME
                   AND A.DEPT &lt;&gt; B.DEPT
  </code></pre>
  
  <p>Somehow I am not getting the expected results.</p>