时间:2021-07-01 10:21:17 帮助过:3人阅读
如果表中有ID
SELECT * FROM dbo.tblMainUser WHERE ID NOT IN (SELECT MAX(ID) FROM tblMainUser GROUP BY UserName,pwd)
如果表中没有自增ID
SELECT IDENTITY(INT,1,1) AS id,* INTO #temp FROM TblTest1 SELECT *FROM #temp WHERE id in( SELECT MAX(id)FROM #temp GROUP BY UserName,Pwd HAVING count(*)>1 )
sqlserver 去重复数据
标签:highlight csharp nbsp HERE max rom select sharp pre