11

偶尔善良 提交于 2019-12-23 02:32:49

delete RemoteDetection201909 WHERE REMOTEDETECTIONID IN (
select ID from (
select MIN(REMOTEDETECTIONID) ID,r.VLPN,r.PASSDATETIME from RemoteDetection201909 r inner join (
select VLPN,substring( convert(varchar,PASSDATETIME,120),1,16) PASSDATETIME,COUNT(1) as num from RemoteDetection201909 where 1=1
group by VLPN,substring( convert(varchar,PASSDATETIME,120),1,16) Having COUNT(1)>1
) a on r.VLPN=a.VLPN
and substring( convert(varchar,a.PASSDATETIME,120),1,16)=substring( convert(varchar,r.PASSDATETIME,120),1,16)
group by r.VLPN,r.PASSDATETIME
) t
)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!