oracle-sql时间区间查询代码,精确到时分秒

自己要写一个时间区间条件查询的需求,自己收集出来的资料,供给大家参考!总共有2种方式.

第一种//我采用的

select * from t1 where 1=1 
and t1.validate_state='1' 
and t1.start_date >= to_date( #{startdate_start},'yyyy-mm-dd hh24:mi:ss') 
and t1.start_date <= to_date( #{startdate_end},'yyyy-mm-dd hh24:mi:ss')

第二种 between and

`select * from t1 where t1.start_date 
between 
to_date(‘2015-10-20 00:00:00’,’yyyy-mm-dd hh24:mi:ss’)

(0)
上一篇 2022年3月22日
下一篇 2022年3月22日

相关推荐