创建一张分区表sales_history_2014,以时间字段分区,2011,2012,2013,and 2014 对应到SAL1,SAL2,SAL3 and SAL4,超过2014年的数据,每个月一个分区:
create table sales_history_2014
(PROD_ID number,
CUST_ID number,
TIME_ID date,
CHANNEL_ID number,
PROMO_ID number,
QUANTITY_SOLD number(10,2))
partition by range(time_id) interval (numtoyMinterval (1,'MONTH'))
(partition sal1 values less than (to_date('2012-01-01','yyyy-mm-dd')),
partition sal2 values less than (to_date('2013-01-01','yyyy-mm-dd')),
partition sal3 values less than (to_date('2014-01-01','yyyy-mm-dd')),
partition sal4 values less than (to_date('2015-01-01','yyyy-mm-dd'))
);
|