日期:2014-05-17 浏览次数:21286 次
select *
from c_data_01
where c_id = '0001'
and c_time in
(select max(collect_time)
from c_data_01
where c_id = '0001'
and c_time >=
to_date('2013-3-6 00:00:00', 'yyyy-mm-dd hh24:mi:ss')
and c_time<
to_date('2013-3-7 00:00:00', 'yyyy-mm-dd hh24:mi:ss')
group by trunc(c_time , 'hh24'))
select *
from c_data_01
where c_id = '0001'
and c_time >=
to_date('2013-3-6 00:00:00', 'yyyy-mm-dd hh24:mi:ss')
and c_time<
to_date('2013-3-7 00:00:00', 'yyyy-mm-dd hh24:mi:ss')
and rownum < 25
/*小时内最大时间*/
insert into p_data
select a1.c_id,a1.c_time,a1.a,a1.b,a1.c
from c_data_01 a1,
(select c_id, max(c_time) c_time
from c_data_01
where c_time >=
to_date('2013-3-6 00:00:00', 'yyyy-mm-dd hh24:mi:ss')
and c