SQL Server 删除表中重复的记录
创建表结构
CREATE TABLE [dbo].[table_1]( [name] [nchar](10) NULL, [id] [nchar](10) NULL ) ON [PRIMARY] GO
输入数据
查询删除语句
with test as ( select name,id,row_number() over(partition by name,id order by id) RowNum from table_1 ) delete from TEST where RowNum > 1
结果
删除成功啦