根据日期查询范围

精确到天

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'

 

内容来源于网络如有侵权请私信删除
你还没有登录,请先登录注册
  • 还没有人评论,欢迎说说您的想法!