分区可以按照两个字段分区,先比较第一个列,如果满足,则忽略第二列,如果第一个不满足,则需要比较第二个列。这种分区的方式有
分区可以按照两个字段分区,,先比较第一个列,如果满足,则忽略第二列,如果第一个不满足,则需要比较第二个列。这种分区的方式有点难以让人理解,建议不要使用。
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 (2014,1),
partition p2 values less than (2014,6),
partition p3 values less than (2014,10),
partition p4 values less than (2014,12),
partition p_max values less than (maxvalue,0));
sql> insert into test values(2013,12,12);
sql> insert into test values(2014,1,17);
sql> insert into test values(2014,7,17);
sql> insert into test values(2014,11,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
本文永久更新链接地址: