--oracle sql日期比较 --在今天之前: select * from up_date where updated_date < to_date('2015-01-15 00:00:00','yyyy-mm-dd hh24:mi:ss') select * from up_date where updated_date <= to_date('2015-01-15 00:00:00','yyyy-mm-dd hh24:mi:ss') --在今天之后: select * from up_date where updated_date > to_date('2015-01-15 00:00:00','yyyy-mm-dd hh24:mi:ss') select * from up_date where updated_date >= to_date('2015-01-15 00:00:00','yyyy-mm-dd hh24:mi:ss') --精确时间: select * from up_date where updated_date = to_date('2015-01-15 00:00:00','yyyy-mm-dd hh24:mi:ss') --在某段时间内: select * from up_date where updated_date between to_date('2014-10-15 00:00:00','yyyy-mm-dd hh24:mi:ss') and to_date('2015-01-15 00:00:00','yyyy-mm-dd hh24:mi:ss') select * from up_date where updated_date < to_date('2015-01-15 00:00:00','yyyy-mm-dd hh24:mi:ss') and update > to_date('2014-10-15 00:00:00','yyyy-mm-dd hh24:mi:ss') select * from up_date where updated_date <= to_date('2015-01-15 00:00:00','yyyy-mm-dd hh24:mi:ss') and update >= to_date('2014-10-15 00:00:00','yyyy-mm-dd hh24:mi:ss') --当然,在实际开发中可以使用trunc函数来精确日期到天 --2015/1/15 select TRUNC(to_date('2015-01-15 00:00:00','yyyy-mm-dd hh24:mi:ss'), 'DD') from dual; select * from up_date where update <= TRUNC(to_date('2015-01-15 00:00:00','yyyy-mm-dd hh24:mi:ss'), 'DD');
文章来源:http://www.blogjava.net/forker/archive/2007/09/07/143467.html
相关推荐
Oracle sql查询当前月的所有日期
oracle sql 根据年份、周数取日期
The book is a revision of the classic Mastering Oracle SQL and SQL*Plus by Lex de Haan, and has been updated to cover the very latest developments in Oracle’s version of the SQL query language....
Oracle 验证是否是日期,帮助你验证给定的字符串是否可以转化为日期。
oracle判断日期是否合法
自己整理的SQL学习笔记,包括常用SQL语句使用方式,通俗易懂,学习SQL必备,
Oracle SQL疑难解析内容简介:《Oracle SQL疑难解析》总结了针对Oracle数据库编写SQL时经常碰到的各种问题,提供大量现成的解决方法,包括汇总和聚合数据、多表数据查询、生成和获取数据、通用查询模式、日期和时间...
Pro Oracle SQL unlocks the power of SQL in the Oracle Database—one of the most potent SQL implementations on the market today. To master it requires a three-pronged approach: learn the language ...
select sysdate from dual 等等一些关于oracle的查询当前时间,日期的一些sql语句的
OracleSQL实例-删除重复数据行留最新日期实例.pdf 学习资料 复习资料 教学资源
Oracle不仅可以通过基本的sql进行简单的数据操作,还可使用对标准sql进行了扩展的PL/SQL语言,可使用如IF…THEN…、WHILE、LOOP等同结构化程序语言一样的构造制作程序,还有制作函数、过程、触发器等也用PL/SQL语言...
向数oracle据库中插入自增日期
ORACLE sql 星期几 一个月的第几天等 方法
Oracle数据库导入到SqlServer步骤(图文篇),自己写的,碰到不少问题,终于解决了。
Mastering.Oracle.SQL英文第二版 最经典的Oracle SQL书籍,无中文版 对你SQL水平有大幅提高 附示例数据表脚本,修复了中文Oracle日期转换问题,绝对原创
《oracle pl/sql程序设计(第5版)》基于oracle数据库11g,从pl/sql编程、pl/sql程序结构、pl/sql程序数据、pl/sql中的sql、pl/sql应用构建、高级pl/sql主题6个方面详细系统地讨论了pl/sql以及如何有效地使用它。...
Oracle通过透明网关连接SQL SERVER的实战记录,包括一些错误解决方法。