TA的每日心情 | 擦汗 昨天 09:07 |
---|
签到天数: 527 天 连续签到: 4 天 [LV.9]测试副司令
|
1测试积点
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');
复制代码
|
|