1.暴力做法:
select * into [QPTreasureDB].dbo.[WinLoseScoreInfo2] from [QPTreasureDB].dbo.[WinLoseScoreInfo]
drop table [WinLoseScoreInfo]
select distinct * into [QPTreasureDB].dbo.[WinLoseScoreInfo] from [WinLoseScoreInfo2]
2.如果表中有id字段可以考虑:先根据指定字段查询重复数据,然后根据不为已的id设置保留数据
select UserId, ServerId, DateId, count(*) as [count], @@rowid--, ROW_NUMBER()over(order by UserId, ServerId, DateId)
from QPTreasureDB.dbo.WinLoseScoreInfo
group by UserId, ServerId, DateId
having count(*) > 1;