当前位置:网站首页>After Oracle creates a table partition, the partition is not given during the query, but the value specified for the partition field will be automatically queried according to the partition?

After Oracle creates a table partition, the partition is not given during the query, but the value specified for the partition field will be automatically queried according to the partition?

2022-07-26 16:52:00 Cloth clothes & mortal dust

Oracle After creating a table partition , Do not give when querying partition, But the value assigned to the partition field , Will it automatically query by partition ?




Take the answer 1:

Meeting :
example :

  
  
  
-- Data preparation :CREATE TABLE t1 ( id number, CD NUMBER (8) NOT NULL) PARTITION BY RANGE(CD)( PARTITION t1_RANGE_10 VALUES LESS THAN (10), PARTITION t1_RANGE_20 VALUES LESS THAN (20), PARTITION t1_RANGE_30 VALUES LESS THAN (30) );insert into t1 values(1,5);insert into t1 values(2,15);insert into t1 values(3,25);select * from t1 partition(t1_RANGE_10);select * from t1 partition(t1_RANGE_20);select * from t1 partition(t1_RANGE_30);SQL> select * from t1 partition(t1_RANGE_10); ID CD---------- ---------- 1 5SQL> select * from t1 partition(t1_RANGE_20); ID CD---------- ---------- 2 15SQL> select * from t1 partition(t1_RANGE_30); ID CD---------- ---------- 3 25

image.png
image.png

If you are satisfied with the answer , Please click the adopt button !



Other answers 1:

Meeting :
example :

  
-- Data preparation :CREATE TABLE t1 ( id number, CD NUMBER (8) NOT NULL) PARTITION BY RANGE(CD)( PARTITION t1_RANGE_10 VALUES LESS THAN (10), PARTITION t1_RANGE_20 VALUES LESS THAN (20), PARTITION t1_RANGE_30 VALUES LESS THAN (30) );insert into t1 values(1,5);insert into t1 values(2,15);insert into t1 values(3,25);select * from t1 partition(t1_RANGE_10);select * from t1 partition(t1_RANGE_20);select * from t1 partition(t1_RANGE_30);SQL> select * from t1 partition(t1_RANGE_10); ID CD---------- ---------- 1 5SQL> select * from t1 partition(t1_RANGE_20); ID CD---------- ---------- 2 15SQL> select * from t1 partition(t1_RANGE_30); ID CD---------- ---------- 3 25

image.png
image.png

If you are satisfied with the answer , Please click the adopt button !

原网站

版权声明
本文为[Cloth clothes & mortal dust]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/207/202207261619461607.html