关于oracle日期查询问题
2009-08-03 09:58
330 查看
可以将日期的格式写入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');
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');
相关文章推荐
- 关于Oracle字段类型Date使用mybatis generator自动生成工具出现的查询日期只精确到年月日问题
- Hibernate查询oracle中日期的右边界问题
- 关于Oracle、Mysql、SQLServer中指定查询结果中返回的行数问题!
- ORACLE关于日期的查询
- 关于oracle sql语句查询时表名和字段名要加双引号的问题详解
- 关于oracle日期格式转换的问题
- 关于对日期类型的数据进行模糊查询的问题
- Oracle sql语句查询日期字段没有时分秒问题
- oracle中所有关于时间日期的问题总结
- 关于oracle中clob字段查询慢的问题及解决方法
- Oracle开发中,关于查询的一个问题
- 关于oracle的多表连接查询,分页的问题
- oracle中所有关于时间日期的问题总结
- oracle关于模糊查询的问题
- 关于日期查询的一个小问题
- 关于SQL中Between语句查询日期的问题
- oracle关于日期时间的查询
- oracle查询日期在查询时解决格式问题
- [转]关于SQL中Between语句查询日期的问题
- 关于oracle中clob字段查询的问题