Remove a duplicated rows ?
This how to remove a duplicated rows, using ROW_NUMBER() :
WITH TempTable (ID,rowNumber)
AS
(
SELECT ID,ROW_NUMBER() OVER(PARTITION by ID ORDER BY ID)
AS rowNumber
FROM CASNOS
)
--Then delete all Duplicate Rows
DELETE FROM TempTable
WHERE rowNumber > 1
That’s it & see you soon!.