日期:2014-05-16 浏览次数:20677 次
with tb(TimePoint,TempValue)as(
select 20131201080100, 20 union
select 20131201080105, 27 union
select 20131201080110, 31 union
select 20131201080115, 32 union
select 20131201080120, 28 union
select 20131201080125, 20 union
select 20131201080130, 20 union
select 20131201080135, 40 union
select 20131201080140, 35 union
select 20131201080145, 20)
,tc as(
select timepoint,tempvalue,row_number() over(order by timepoint)num from tb)
select * from tc a
where not exists(select 1 from tc where a.num-1=num and TempValue/30=a.TempValue/30)