SqlServer_删除重复行只保留一条记录
时间:2021-07-01 10:21:17
帮助过:3人阅读
FROM
[Log_IIS].[dbo].[IISLog_table]
WHERE id not in
(select MAX(Id) from [IISLog_table] group by [RequestTime]
,[LogFilename]
,[LogRow]
,[date]
,[time]
,[cIp]
,[csUsername]
,[sSitename]
,[sComputername]
,[sIp]
,[sPort]
,[csMethod]
,[csUriStem]
,[csUriQuery]
,[scStatus]
,[scSubstatus]
,[scWin32Status]
,[scBytes]
,[csBytes]
,[timeTaken]
,[csVersion]
,[csHost]
,[csUserAgent]
,[csCookie]
,[csReferer]
,[sEvent]
,[sProcessType]
,[sUserTime]
,[sKernelTime]
,[sPageFaults]
,[sTotalProcs]
,[sActiveProcs]
,[sStoppedProcs] having count(*) > 1)
来自为知笔记(Wiz)
SqlServer_删除重复行只保留一条记录
标签: