Oracle表分区之范围分区
以表中的一个列或一组列的值的范围分区
语法:
[sql]
PARTITION BY RANGE (column_name)
( www.2cto.com
PARTITION part1 VALUE LESS THAN(range1),
PARTITION part2 VALUE LESS THAN(range2),
…
[PARTITION partN VALUE LESS THAN(MAXVALUE)]
);
范围分区示例1:
[sql]
CREATE TABLE SALES2 (
PRODUCT_ID VARCHAR2(5),
SALES_DATE DATE NOT NULL,
SALES_COST NUMBER(10))
PARTITION BY RANGE (SALES_DATE)
(
PARTITION P1 VALUES LESS THAN (DATE ‘2003-01-01’),
PARTITION P2 VALUES LESS THAN (DATE ‘2004-01-01’),
PARTITION P3 VALUES LESS THAN (MAXVALUE)
);
范围分区示例2:
[sql]
CREATE TABLE Sales
( www.2cto.com
Product_ID varchar2 (5),
Sales_Cost number (10)
)
PARTITION BY RANGE (Sales_Cost)
(
PARTITION P1 VALUES LESS THAN (1000),
PARTITION P2 VALUES LESS THAN (2000),
PARTITION P3 VALUES LESS THAN (3000)
);
作者 jason5186