Monday, 20 June 2016

Delete Duplicate Row From SQL SERVER

AS SALAMO ALAIKUM WA RAHMATULLAH

WITH CTE (Fname,Lname, DuplicateCount)
AS
(
SELECT Fname,Lname,
ROW_NUMBER() OVER(PARTITION BY Fname,Lname ORDER BY Fname) AS DuplicateCount
FROM tbl_employee
)
DELETE
FROM CTE
WHERE DuplicateCount > 1

GO
--
MA ASALAAM
Passion 4 Oracle