码迷,mamicode.com
首页 > 数据库 > 详细

oracle

时间:2014-12-09 00:17:44      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:blog   http   ar   sp   log   bs   html   时间   tt   

时间Date类型比较

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函数高一些。

查询2000年以后的:select sum(SaleNum) from SCOTT.Sale where saledate>=to_date(‘2000‘,‘yyyy‘)

其他关于日期可参考:http://www.cnblogs.com/hl3292/archive/2010/11/03/1868159.html

oracle

标签:blog   http   ar   sp   log   bs   html   时间   tt   

原文地址:http://www.cnblogs.com/qingxinblog/p/4152136.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!