去掉重复里程结算数据,笔记

  DELETE FROM IOV_Settlement_Mileage WHERE VehId IN (select VehId from [IOV_Settlement_Mileage] group by VehId having count(VehId) > 1)
AND
SettlementTime NOT IN (select min(SettlementTime) from [IOV_Settlement_Mileage] group by VehId having count(VehId)>1) 
AND DataDate BETWEEN '2018-12-18 00:00:00' AND  '2018-12-18 23:59:59'

  

posted @ 2018-12-21 00:03  dotNet修行之路  阅读(199)  评论(0编辑  收藏  举报