自己要写一个时间区间条件查询的需求,自己收集出来的资料,供给大家参考!总共有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’)
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Oracle字符串函数length、upper、lower、initcap、 concat、instr、replace
网友评论