重庆思庄Oracle、Redhat认证学习论坛

标题: oracle 11g 分区之五:间隔分区 [打印本页]

作者: 郑全    时间: 2018-9-7 17:33
标题: oracle 11g 分区之五:间隔分区
CREATE TABLE  SALES_HISTORY_2006
  (
   PROD_ID NUMBER NOT NULL,
  CUST_ID NUMBER NOT NULL,
  TIME_ID DATE NOT NULL,
  CHANNEL_ID NUMBER NOT NULL,
  PROMO_ID NUMBER NOT NULL,
  QUANTITY_SOLD NUMBER(10,2) NOT NULL,
  AMOUNT_SOLD NUMBER(10,2) NOT NULL
  )
PARTITION BY RANGE (TIME_ID)
   interval (numtoyminterval('1','month'))
(PARTITION "SAL1" VALUES LESS THAN (TO_DATE('1/1/2002','MM/DD/YYYY')),
  PARTITION "SAL2" VALUES LESS THAN (TO_DATE('1/1/2003','MM/DD/YYYY')),
  PARTITION "SAL3" VALUES LESS THAN (TO_DATE('1/1/2004','MM/DD/YYYY')),
  PARTITION "SAL4" VALUES LESS THAN (TO_DATE('1/1/2005','MM/DD/YYYY'))
  );






欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2