Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

declare @T table
  id int,
  name varchar(10),
  roll int,
  class int

insert into @T values

select id, name, roll, class
from (select id, name, roll, class,
             count(*) over(partition by name, roll, class) as c
      from @T) as T
where c > 1
order by id

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results