Dears,

There are many ways to eliminate the duplicate records but using the CTE concept is amazing!!!

-- MSSQL 2005 and onwards

;WITH EliminateDup(Name,id,SAL,ROWID) AS
(
SELECT name,ID ,SAL,ROW_NUMBER()OVER(PARTITION BY name,ID,SAL ORDER BY ID)AS ROWID
FROM DUP1
)
--SELECT * FROM EliminateDup WHERE ROWID>1 -- to find out the duplicates
DELETE EliminateDup WHERE ROWID>1 -- to delete the duplicate records


-- akhilesh narayanan