Delete duplicate row from the table
How can we delete duplicate row from the table through the SQL query ?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Posted May 29, 2012, 2:08 AM EDT
ex: select distinct(empname) from employee
Satyapriya NayakRank #47 · 31.5K reputationPosted May 29, 2012, 3:01 AM EDT
STEP 1 - Insert your distinct data into a temporary table select distinct* into temp from TableName
STEP 2 - Delete From TableName
STEP 3 - Insert TableName Select * From temp Write three step and remove duplicate values from your tables.
Thanks
Anil KumarRank #367 · 6.8K reputationPosted May 29, 2012, 5:05 AM EDT
Refer: Removing Duplicates from a Table in SQL Server
Using JOIN, a good example can be found @
SQL Query to get rid of duplicate records