51Testing软件测试论坛
标题:
Oracle分区表跨分区查询数据为空
[打印本页]
作者:
测试积点老人
时间:
2020-3-9 10:58
标题:
Oracle分区表跨分区查询数据为空
Oracle分区表跨分区查询数据为空
创建分区表的语句,PLATTIME是一个时间字段
ALTER TABLE TORDER MODIFY
PARTITION BY RANGE (PLATTIME)
(
partition p1801 values less than (to_timestamp('2018-01-01', 'YYYY-MM-DD')),
partition p1805 values less than (to_timestamp('2018-05-01', 'YYYY-MM-DD')),
partition p1808 values less than (to_timestamp('2018-08-01', 'YYYY-MM-DD')),
partition p1810 values less than (to_timestamp('2018-10-01', 'YYYY-MM-DD')),
partition p1812 values less than (to_timestamp('2018-12-01', 'YYYY-MM-DD')),
partition p1901 values less than (to_timestamp('2019-01-01', 'YYYY-MM-DD')),
partition p1902 values less than (to_timestamp('2019-02-01', 'YYYY-MM-DD')),
partition p1903 values less than (to_timestamp('2019-03-01', 'YYYY-MM-DD')),
partition p1904 values less than (to_timestamp('2019-04-01', 'YYYY-MM-DD')),
partition p1905 values less than (to_timestamp('2019-05-01', 'YYYY-MM-DD')),
partition p1906 values less than (to_timestamp('2019-06-01', 'YYYY-MM-DD')),
partition p1907 values less than (to_timestamp('2019-07-01', 'YYYY-MM-DD')),
partition p1908 values less than (to_timestamp('2019-08-01', 'YYYY-MM-DD')),
partition pmax values less than (maxvalue)
)ONLINE
UPDATE INDEXES;
复制代码
在没有进行分区之前使用以下sql语句是可以查询到数据的,分区后再查询获取的数据为空
select * from TORDER where PLATTIME BETWEEN to_timestamp('2018-01-01', 'YYYY-MM-DD') and to_timestamp('2018-09-01', 'YYYY-MM-DD');
复制代码
作者:
qqq911
时间:
2020-3-10 10:20
查询区间加大一点
作者:
bellas
时间:
2020-3-10 11:05
是不是没有分区成功呢
作者:
jingzizx
时间:
2020-3-10 13:40
正确与否啊
作者:
海海豚
时间:
2020-3-10 15:26
怀疑没分区成功
作者:
abcsell
时间:
2020-3-10 16:00
联合查询
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2