select * from aaa where to_char(rq,'yyyymmdd') between '20011101' and '20020301';
直接在rq上加函数,如果应用大(这个表内数据很多时),查询速度会相当慢的,为了提高查询速度,强烈建议这样书写: select * from aaa where rq between to_date('2001-11-01','yyyy-MM-DD') and to_date('2002-03-01' ,'YYYY-MM-DD');
推荐使用 select * from aaa where rq>;=to_date('2001-11-01','yyyy-MM-DD') and rq<=to_date('2002-03-01' ,'YYYY-MM-DD');
用between的函数可能会慢些 select * from table1 where 时间段 between to_date('2010-05-03 09','yyyy-mm-dd hh24') and to_date('2010-05-03 12','yyyy-mm-dd hh24');
下个Oracle for vista 版本的安装试试 10G和11G的 http://www.oracle.com/technology/software/products/database/index.html ------------------------------------------- ......