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;