Wednesday, June 26, 2013

how to delete Duplicate record in sql?

DELETE SUB FROM
(SELECT ROW_NUMBER() OVER (PARTITION BY field2val ORDER BY field2val) cnt
 FROM tab1) SUB
WHERE SUB.Cnt > 1

No comments:

Post a Comment