专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Oracle开发

orcale 把日期当作查询条件

发布时间:2010-05-20 14:01:29 文章来源:www.iduyao.cn 采编人员:星星草
orcale 把日期当做查询条件

根据日期查询范围

精确到天

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'

 

友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: