Nilesh Avhad
How to find only duplicate records from the table in SQL server?
By Nilesh Avhad in SQL Server on Jul 16 2014
  • shambhoo prajapati
    Aug, 2014 28

    select name from emp group by name HAVING COUNT(*) > 1

    • 1
  • Lalit Raghuvanshi
    Feb, 2015 5

    Please refer the article Remove duplicate records/data from Sql Server database table http://www.webcodeexpert.com/2013/11/how-to-remove-duplicate-recordsdata.html

    • 0
  • shushil kumar
    Aug, 2014 26

    select id, count(*) as numberduplicate from TableName group by id having count(*) >1 order by id

    • 0
  • Rabinarayana Nanda
    Aug, 2014 5

    select COLUMNNAME from TABLENAME group by COLUMNNAME having COUNT(COLUMNNAME )>1

    • 0
  • Sumit Jolly
    Aug, 2014 1

    I agree with Sandesh's answer

    • 0
  • Sandesh Patil
    Jul, 2014 24

    with x as (select *, rn=ROW_NUMBER()over(PARTITION BY username, userrole order by userid) from t_user )select * from x where rn>1

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS