日期:2014-05-20 浏览次数:20798 次
select top 100 m.* from OriginalData as m ,
(
select convert(varchar(13),DataInsertingTime,120)+':00:00' DataInsertingTime,
min(abs(datediff(ss , DataInsertingTime , convert(varchar(13),DataInsertingTime,120)+':00:00'))) ss from OriginalData
group by convert(varchar(13),DataInsertingTime,120)+':00:00'
)
as n
where convert(varchar(13),m.DataInsertingTime,120)+':00:00' = n.DataInsertingTime and abs(datediff(ss,m.DataInsertingTime,n.DataInsertingTime)
) = n.ss and m.DeviceMonitorObjectID='78871381-25A2-40D4-8E4A-6100F174BD37' order by DataInsertingTime desc