oracle查询时间区间段数据

一.

查询给定时间在开始时间列与结束时间列范围中数据;

  select * from t  表名 where t.日期列 >= to_date('20xx-xx-xx 00:00:00','yyyy-mm-dd hh24:mi:ss') and t.日期列 <= to_date('20xx-xx-xx 23:59:59','yyyy-mm-dd hh24:mi:ss')

二.

查询日期列在开始时间列与结束时间列范围中数据;

select * from 表名 t where t.日期列 between to_date('20xx-xx-xx 00:00:00','yyyy-mm-dd hh24:mi:ss')and to_date('20xx-xx-xx 23:59:59','yyyy-mm-dd hh24:mi:ss')
posted @ 2019-12-18 17:24  ZuiTaiPing  阅读(258)  评论(0)    收藏  举报