If you have knowledge, let others light their candles with it.
Search This Blog
Wednesday, June 26, 2013
Deleting duplicate Rows using With Statement in SQL...
WITH CTE AS
(
SELECT rn = ROW_NUMBER()
OVER(
PARTITION BY id, parentid, serial_no, text
ORDER BY Id ASC), *
FROM XXXXXXXX where Url like '%_layouts/trav%'
)
delete FROM cte
WHERE rn > 1
No comments:
Post a Comment