title: skip records based on columns condition
body: <p>I have a question in sql server</p>
  
  <p>table name : Emp</p>
  
  <pre><code>Id  |Pid  |Firstname| LastName  | Level
  1   |101  | Ram     |Kumar      | 3
  1   |100  | Ravi    |Kumar      | 2
  2   |101  | Jaid    |Balu       | 10
  1   |100  | Hari    | Babu      | 5
  1   |103  | nani    | Jai       |44
  1   |103  | Nani    | Balu      |10
  3   |103  |bani     |lalu       |20
  </code></pre>
  
  <p>Here need to retrieve unique records based on id and Pid columns and records which have duplicate  records need to skip.</p>
  
  <p>Finally I want output like below</p>
  
  <pre><code>Id  |Pid  |Firstname| LastName  | Level
  1   |101  | Ram     |Kumar      | 3
  2   |101  | Jaid    |Balu       | 10
  3   |103  |bani     |lalu       |20
  </code></pre>
  
  <p>I found duplicate records based on below query</p>
  
  <pre><code>select id,pid,count(*) from emp group by id,pid having count(*) &gt;=2
  </code></pre>
  
  <p>this query get duplicated records 2 that records need to skip to retrieve output</p>
  
  <p>please tell me how to write query to achieve this task in sql server.</p>