How to delete duplicate rows in SQL Server 2008?

前端 未结 4 1302
栀梦
栀梦 2021-01-06 18:26

How can I delete duplicate rows in SQL Server 2008?

4条回答
  •  温柔的废话
    2021-01-06 19:00

    Even though u dont have a Primary key, u can delete the duplicate data by the below code

    delete from (Tablename)
              where tablename.%%physloc%%
              NOT IN (select MIN(b.%%physloc%%)
              from tablename b
              group by b.Column1,b.column2,b.column3
              );
    

提交回复
热议问题