--一条语句删除表中相同的记录
--测试数据
Declare @ Table
(
id int identity,
sName varchar(10)
)
Insert into @ Select '张三'
Insert into @ Select '王二'
Insert into @ Select '张三'
Insert Into @ Select '李四'
Insert into @ Select '王二'
Delete from @
where not id in (select Max(id) from @ Group by sName)
Select * from @