sql 取2个日期之间的数据

    1. select * from table1 where larq between(to_date('2008-9-3','yyyy-mm-dd')) and (to_date('2008-9-5','yyyy-mm-dd')) 
      2.select * from table1 where larq>=to_date('2008-9-3','yyyy-mm-dd') and larq <=to_date('2008-9-5','yyyy-mm-dd')

select count(1) from T_VEHICLE t where t.createts between to_date('2015-7-7 17:13:00','yyyy/mm/dd hh24:mi:ss') and to_date('2015-7-7 20:55:00','yyyy/mm/dd hh24:mi:ss')

to_date('2015-7-7 17:13:00','yyyy/mm/dd hh24:mi:ss')

to_char(sysdate,'yyyy/mm/dd hh24:mi:ss')

to_date是oracle的文本转日期函数,必须这样用
同样,日期转文本要用to_char函数
文本转数值要用to_number函数

原文地址:https://www.cnblogs.com/yousen/p/4629520.html