create table shipments
( order_id number not null
, order_date date not null
, ship_date date not null
, customer_id number not null
, sales_amount number not null
)
Oracle Database 11g New Features Cookbook
CONFIDENTIAL 52 Oracle Korea
partition by range (order_date)
subpartition by range (ship_date)
( partition p_2006_jul values
less than (to_date('01-AUG-2006','dd-MON-yyyy'))
( subpartition p_2006_jul_early values
less than (to_date('15-AUG-2006','dd-MON-yyyy'))
, subpartition p_2006_jul_agreed values
less than (to_date('01-SEP-2006','dd-MON-yyyy'))
, subpartition p_2006_jul_late values less than (maxvalue)
)
, partition p_2006_aug values
less than (to_date('01-SEP-2006','dd-MON-yyyy'))
( subpartition p_2006_aug_early values
less than (to_date('15-SEP-2006','dd-MON-yyyy'))
, subpartition p_2006_aug_agreed values
less than (to_date('01-OCT-2006','dd-MON-yyyy'))
, subpartition p_2006_aug_late values less than (maxvalue)
)
, partition p_2006_sep values
less than (to_date('01-OCT-2006','dd-MON-yyyy'))
( subpartition p_2006_sep_early values
less than (to_date('15-OCT-2006','dd-MON-yyyy'))
, subpartition p_2006_sep_agreed values
less than (to_date('01-NOV-2006','dd-MON-yyyy'))
, subpartition p_2006_sep_late values less than (maxvalue)
)
, partition p_2006_oct values
less than (to_date('01-NOV-2006','dd-MON-yyyy'))
( subpartition p_2006_oct_early values
less than (to_date('15-NOV-2006','dd-MON-yyyy'))
, subpartition p_2006_oct_agreed values
less than (to_date('01-DEC-2006','dd-MON-yyyy'))
, subpartition p_2006_oct_late values less than (maxvalue)
)
, partition p_2006_nov values
less than (to_date('01-DEC-2006','dd-MON-yyyy'))
( subpartition p_2006_nov_early values
less than (to_date('15-DEC-2006','dd-MON-yyyy'))
, subpartition p_2006_nov_agreed values
less than (to_date('01-JAN-2007','dd-MON-yyyy'))
, subpartition p_2006_nov_late values less than (maxvalue)
)
, partition p_2006_dec values
less than (to_date('01-JAN-2007','dd-MON-yyyy'))
( subpartition p_2006_dec_early values
less than (to_date('15-JAN-2007','dd-MON-yyyy'))