select * from your_table where (to_number(to_char(your_date_column,'mi')) between 6 and 9) and (your_date_column between to_date('20101001','yyyymmdd') and to_date('20101101','yyyymmdd'))
select * from tablename where to_char(col,'dd') between 1 and 31 and to_char(col,'hh24') between 6 and 9
select * from your_table where (to_number(to_char(your_date_column,'hh24')) between 6 and 9) and (your_date_column between to_date('20101001','yyyymmdd') and to_date('20101101','yyyymmdd'))
缺少月份select * from tablename where to_char(col,'mm')='10' and to_char(col,'dd') between 1 and 31 and to_char(col,'hh24') between 6 and 9
写错了时间 select * from your_table where (to_number(to_char(your_date_column,'hh24')) between 6 and 9) and (your_date_column between to_date('20101001','yyyymmdd') and to_date('20101101','yyyymmdd'))
谢谢提醒 select * from tablename where to_char(col,'yyyymmdd') between 20101001 and 20101031 and to_char(col,'hh24') between 6 and 9
--dateti --20100909 151515 --20101015 161616 --20111001 171717 --20101015 070707 --sql select * from yyq_date where (to_number(to_char(dateti,'hh24')) between 6 and 9) and (dateti between to_date('20101001','yyyymmdd') and to_date('20101101','yyyymmdd')) --------------------------------------------------------------------------------------- 2010/10/15 07:07:07
where (to_number(to_char(your_date_column,'mi')) between 6 and 9)
and (your_date_column between to_date('20101001','yyyymmdd') and to_date('20101101','yyyymmdd'))
where to_char(col,'dd') between 1 and 31
and to_char(col,'hh24') between 6 and 9
where (to_number(to_char(your_date_column,'hh24')) between 6 and 9)
and (your_date_column between to_date('20101001','yyyymmdd') and to_date('20101101','yyyymmdd'))
where to_char(col,'mm')='10'
and to_char(col,'dd') between 1 and 31
and to_char(col,'hh24') between 6 and 9
select * from your_table
where (to_number(to_char(your_date_column,'hh24')) between 6 and 9)
and (your_date_column between to_date('20101001','yyyymmdd') and to_date('20101101','yyyymmdd'))
select * from tablename
where to_char(col,'yyyymmdd') between 20101001 and 20101031
and to_char(col,'hh24') between 6 and 9
--dateti
--20100909 151515
--20101015 161616
--20111001 171717
--20101015 070707
--sql
select * from yyq_date
where (to_number(to_char(dateti,'hh24')) between 6 and 9)
and (dateti between to_date('20101001','yyyymmdd') and to_date('20101101','yyyymmdd'))
---------------------------------------------------------------------------------------
2010/10/15 07:07:07