Partitions by the range of values of one or more columns in a table.
Syntax:
- PARTITIONBYRANGE (column_name)
- (
- PARTITION part1 value less than (range1 ),
- PARTITION part2 value less than (range2 ),
- ...
- [PARTITION partN value less than (MAXVALUE)]
- );
Range partition Example 1:
- CREATE TABLESALES2 (
- PRODUCT_ID VARCHAR2 (5 ),
- SALES_DATEDATE NOT NULL,
- SALES_COST NUMBER (10 ))
- PARTITIONBYRANGE (SALES_DATE)
- (
- PARTITION P1VALUESLess (DATE'2017-01-01 '),
- PARTITION P2VALUESLess (DATE'2017-01-01 '),
- PARTITION P3VALUESLess than (MAXVALUE)
- );
Range partition Example 2:
- CREATE TABLESales
- (
- Product_ID varchar2 (5 ),
- Sales_Cost number (10)
- )
- PARTITIONBYRANGE (Sales_Cost)
- (
- PARTITION P1VALUESLess than (1000 ),
- PARTITION P2VALUESLess than (2000 ),
- PARTITION P3VALUESLess than (3000)
- );
For more information about Oracle, see Oracle topics page http://www.bkjia.com/topicnews.aspx? Tid = 12