测试积点老人 发表于 2020-3-9 10:58:11

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:32

查询区间加大一点

bellas 发表于 2020-3-10 11:05:54

是不是没有分区成功呢

jingzizx 发表于 2020-3-10 13:40:42

正确与否啊

海海豚 发表于 2020-3-10 15:26:49

怀疑没分区成功

abcsell 发表于 2020-3-10 16:00:52

联合查询
页: [1]
查看完整版本: Oracle分区表跨分区查询数据为空