17,377
社区成员
发帖
与我相关
我的任务
分享
select distinct a.test, a.test2, a.test3, a.test4,a.time
from testtime a
where a.test1 in ('11', '22')
and a.time between to_date('2011-10-15 08:30', 'YYYY-mm-dd hh24:mi') and
to_date('2011-10-15 09:00', 'YYYY-mm-dd hh24:mi')
SELECT a.test, a.test2, a.test3, a.test4,a.time
FROM testtime a
WHERE a.test1 in ('11', '22')
AND (a.time BETWEEN TO_DATE('2011-10-15 00:00', 'YYYY-mm-dd hh24:mi')
AND TO_DATE('2011-11-05 00:00', 'YYYY-mm-dd hh24:mi'))
AND TO_CHAR(a.time,'hh24:mi') between '08:30' and '09:00' ;
select distinct a.test, a.test2, a.test3, a.test4,a.time
from testtime a
where a.test1 in ('11', '22')
and a.time >= to_date('2011-10-15 00:00', 'YYYY-mm-dd hh24:mi')
and a.time < to_date('2011-11-05 00:00', 'YYYY-mm-dd hh24:mi')
and to_char(a.time,'hh24:mi') between '08:30' and '09:00' ;
where trunc(a.time,'dd') between to_date('2011-10-15', 'YYYY-mm-dd') and to_date('2011-11-04', 'YYYY-mm-dd')
and
a.time-trunc(a.time,'dd') between to_date('2011-10-15 08:30', 'YYYY-mm-dd hh24:mi')-to_date('2011-10-15', 'YYYY-mm-dd') and to_date('2011-10-15 09:00', 'YYYY-mm-dd hh24:mi')-to_date('2011-10-15', 'YYYY-mm-dd')
select distinct a.test, a.test2, a.test3, a.test4,a.time
from testtime a
where a.test1 in ('11', '22')
and a.time >= to_date('2011-10-04 00:00', 'YYYY-mm-dd hh24:mi')
and a.time < to_date('2011-11-16 00:00', 'YYYY-mm-dd hh24:mi')
and to_char(a.time,'hh24:mi') between '08:30' and '09:00' ;