Oracle multi-key partition Test
Partitions can be partitioned by two fields. The first column is compared first. If yes, the second column is ignored. If the first column is not met, the second column needs to be compared. This partitioning method is a bit difficult to understand. We recommend that you do not use it.
SQL> select * from v $ version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production
PL/SQL Release 11.2.0.1.0-Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0-Production
NLSRTL Version 11.2.0.1.0-Production
SQL> create table test (
Year number (4 ),
Month number (4 ),
Day number (4 ))
Partition by range (year, month)
(Partition p1 values less than (2011,1 ),
Partition p2 values less than (hz6 ),
Partition p3 values less than (hz10 ),
Partition p4 values less than (hz12 ),
Partition p_max values less than (MAXVALUE, 0 ));
SQL> insert into test values (maid, 12 );
SQL> insert into test values (, 17 );
SQL> insert into test values (, 17 );
SQL> insert into test values (, 1 );
SQL> commit;
SQL> select * from test partition (p1 );
YEAR MONTH DAY
------------------------------
2013 12 12
SQL> select * from test partition (p2 );
YEAR MONTH DAY
------------------------------
2014 1 17
SQL> select * from test partition (p3 );
YEAR MONTH DAY
------------------------------
2014 7 17
SQL> select * from test partition (p4 );
YEAR MONTH DAY
------------------------------
2014 11 1