当前位置:Gxlcms > 数据库问题 > sql 取2个日期之间的数据

sql 取2个日期之间的数据

时间:2021-07-01 10:21:17 帮助过:3人阅读

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函数

sql 取2个日期之间的数据

标签:

人气教程排行