可以将日期的格式写入Oracle注册表
regedit ->Local Machine->Software->ORACLE->HOMEO
增加关键字:nls_date_format
键 值:日期格式yyyy-mm-dd hh24:mi:ss(注意:没有单引号)
然后查询 select * from tablename where opertime=to_date('2007-04-10');
或者在sql/plus中用下列方法
alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
select * from tablename where opertime=to_date('2007-04-10');
或
select * from mytable where to_char(install_date,'YYYYMMDD') > '20050101'
select * from mytable where install_date > to_date('20050101','yyyymmdd');