select f.* from tab_regulation f
where '1987/8/8'<f.release_date < '2012/5/9'
and '1987/8/8'<f.apply_date < '2012/5/9'
--错误的
select f.* from tab_regulation f
where (
(f.release_date between to_date('1987-8-8','YYYY-MM-DD') and to_date('2012-5-9','YYYY-MM-DD'))
and
(f.apply_date between to_date('1987-8-8','YYYY-MM-DD') and to_date('2012-5-9','YYYY-MM-DD')))
--输出3
select f.* from tab_regulation f
where (
(f.release_date between to_date('1987-8-8 12:00:00','yyyy/mm/dd HH24:mi:ss') and to_date('2012-5-9 23:59:59','yyyy/mm/dd HH24:mi:ss'))
and
(f.apply_date between to_date('1987-8-8 12:00:00','yyyy/mm/dd HH24:mi:ss') and to_date('2012-5-9 23:59:59','yyyy/mm/dd HH24:mi:ss')))
--输出9
where '1987/8/8'<f.release_date < '2012/5/9'
and '1987/8/8'<f.apply_date < '2012/5/9'
--错误的
select f.* from tab_regulation f
where (
(f.release_date between to_date('1987-8-8','YYYY-MM-DD') and to_date('2012-5-9','YYYY-MM-DD'))
and
(f.apply_date between to_date('1987-8-8','YYYY-MM-DD') and to_date('2012-5-9','YYYY-MM-DD')))
--输出3
select f.* from tab_regulation f
where (
(f.release_date between to_date('1987-8-8 12:00:00','yyyy/mm/dd HH24:mi:ss') and to_date('2012-5-9 23:59:59','yyyy/mm/dd HH24:mi:ss'))
and
(f.apply_date between to_date('1987-8-8 12:00:00','yyyy/mm/dd HH24:mi:ss') and to_date('2012-5-9 23:59:59','yyyy/mm/dd HH24:mi:ss')))
--输出9