首页 > 其他 > 详细

orcale 把日期当做查询条件

时间:2017-09-28 18:59:47      阅读:402      评论:0      收藏:0      [点我收藏+]

根据日期查询范围

精确到天

select * from table where to_char( time,‘yyyy mm dd ‘ )  <=   ‘2000 01 01‘

 

select * from table where to_char( time,‘yyyy-mm-dd ‘ )  <= ‘2000-01-01‘

 

select * from table where to_char( time,‘yyyy/mm/dd ‘ )  <= ‘2000/01/01‘

精确到秒

select * from table where to_char( time,‘yyyy mm dd hh24 mi ss‘ )  <=   ‘2000 01 01 12 12 12‘

 

select * from table where to_char( time,‘yyyy-mm-dd hh24-mi-ss‘ )  <= ‘2000-01-01 12-12-12‘

 

select * from table where to_char( time,‘yyyy/mm/dd hh24:mi:ss‘ )  <= ‘2000/01/01 12:12:12‘

 

orcale 把日期当做查询条件

原文:http://www.cnblogs.com/gczmn/p/7608035.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!