title: How to get non matching records in sql server in same table?
body: <p>I have a table say <code>StudentBillDetails</code> and in this table data is saved annually and <code>yrid</code> is referenced to some other table. Now I am stuck with a problem. I want to retrieve non matching records as described below.</p>
  
  <pre><code>Stid    BillNo  Yrid
  1        525    3
  1        525    1
  1        525    4
  2        443    4
  2        442    1
  2        443    3
  </code></pre>
  
  <p>In above given table structure as you can see for three years <code>StId 1</code> has same value but <code>StId 2</code> has a confliction in <code>Yrid 1</code>. So I want to get these type of records.</p>