oracle中查找某一个时间段内的数据

Select * from a where date between to_date(‘2018-1-1’, ‘yyyy-mm-dd’) and to_date(‘2018-8-1’,‘yyyy-mm-dd’)

查询结果
在这里插入图片描述

1)select * from tableName t where start_times > to_date(‘2015/6/26 10:00:00’,‘yyyy/mm/dd hh24:mi:ss’);

2)select * from tableName t where start_times < to_date(‘2015/6/26 10:00:00’,‘yyyy/mm/dd hh24:mi:ss’);

3)select * from tableName t where start_times between to_date(‘2015/6/26 10:00:00’,‘yyyy/mm/dd hh24:mi:ss’) and to_date(‘2015/6/26 11:00:00’,‘yyyy/mm/dd hh24:mi:ss’);

猜你喜欢

转载自blog.csdn.net/weixin_44447804/article/details/91412156