SQL
Thursday, 17 June 2010
Duplicate delete all rows in table
with CTE(COL1,COL2,DUPLICATECOUNT
AS(
select COL1,COL2,ROW_NUMBER() OVER(partition by COL1,COL2 order by COl1)as DUPLICATECOUNT from TABELNAME
)
DELETE from CTE WHERE DUPLICATECOUNT >1
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment