hi
i have a table named "emp"
id name sal
1 a 20000
2 b 30000
3 c 40000
from this table i want to delete duplicate rows
help me
thanks in advance........
Hi Kantikh,
You need to select all the distinct data to temp table and then delete all the data from the base table and then reinsert the data from the temp table as following
SELECT DISTINCT * INTO #temp FROM emp TRUNCATE TABLE emp --DELETE emp INSERT INTO emp SELECT * FROM #temp DROP TABLE #temp
Thanks and Regards,
Rk_Hirpara
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.