Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
deepakugale
Starting Member
33 Posts |
Posted - 2010-02-17 : 00:48:14
|
| Hi Experts,What are different methods to remove duplicate entries from tables ? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-17 : 00:59:21
|
http://www.databasejournal.com/features/mssql/article.php/1438651/Removing-Duplicate-Records.htmalso SQL 2005 methods likeDELETE tFROM(SELECT ROW_NUMBER() OVER(PARTITION BY <duplicate column set> ORDER BY PK) AS SeqFROM Table)tWHERE Seq=1DELETE tFROM Table tCROSS APPLY (SELECT TOP 1 PK FROM Table WHERE <duplicate column set>=t.<duplicate column set> ORDER BY PK) t1WHERE t1.PK<>t.PK ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|