orcale 把日期当做查询条件

深碍√TFBOYSˉ_ 2022-06-01 08:17 287阅读 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’

发表评论

表情:
评论列表 (有 0 条评论,287人围观)

还没有评论,来说两句吧...

相关阅读