oracle 根據虛擬列建立以周幾為單位的分割槽表
SQL> create table t2(rid number,rname varchar2(20),rdate date,week_num number generated always as (to_char(rdate,'d'))) 2 partition by list(week_num) 3 ( 4 partition rdate1 values (1), 5 partition rdate2 values (2), 6 partition rdate3 values (3), 7 partition rdate4 values (4), 8 partition rdate5 values (5), 9 partition rdate6 values (6), 10 partition rdate7 values (7) 11 ); Table created. SQL> insert into t2(rid,rname,rdate) values(5,'thursday',sysdate); 1 row created. SQL> insert into t2(rid,rname,rdate) values(6,'friday',sysdate+1); 1 row created. SQL> insert into t2(rid,rname,rdate) values(7,'saturday',sysdate+2); 1 row created. SQL> insert into t2(rid,rname,rdate) values(1,'sunday',sysdate+3); 1 row created. SQL> insert into t2(rid,rname,rdate) values(2,'monday',sysdate+4); 1 row created. SQL> insert into t2(rid,rname,rdate) values(3,'tuesday',sysdate+5); 1 row created. SQL> insert into t2(rid,rname,rdate) values(4,'wednesday',sysdate+6); 1 row created. SQL> commit; Commit complete. SQL> select * from t2; RID RNAME RDATE WEEK_NUM ---------- -------------------- ------------ ---------- 1 sunday 31-JAN-21 1 2 monday 01-FEB-21 2 3 tuesday 02-FEB-21 3 4 wednesday 03-FEB-21 4 5 thursday 28-JAN-21 5 6 friday 29-JAN-21 6 7 saturday 30-JAN-21 7 7 rows selected. SQL> select * from t2 partition(rdate1); RID RNAME RDATE WEEK_NUM ---------- -------------------- ------------ ---------- 1 sunday 31-JAN-21 1 SQL> select * from t2 partition(rdate2); RID RNAME RDATE WEEK_NUM ---------- -------------------- ------------ ---------- 2 monday 01-FEB-21 2 SQL> select * from t2 partition(rdate3); RID RNAME RDATE WEEK_NUM ---------- -------------------- ------------ ---------- 3 tuesday 02-FEB-21 3 SQL> select * from t2 partition(rdate4); RID RNAME RDATE WEEK_NUM ---------- -------------------- ------------ ---------- 4 wednesday 03-FEB-21 4 SQL> select * from t2 partition(rdate5); RID RNAME RDATE WEEK_NUM ---------- -------------------- ------------ ---------- 5 thursday 28-JAN-21 5 SQL> select * from t2 partition(rdate6); RID RNAME RDATE WEEK_NUM ---------- -------------------- ------------ ---------- 6 friday 29-JAN-21 6 SQL> select * from t2 partition(rdate7); RID RNAME RDATE WEEK_NUM ---------- -------------------- ------------ ---------- 7 saturday 30-JAN-21 7
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28572479/viewspace-2754210/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- PLSQL根據分割槽表的分割槽名批次truncate分割槽SQL
- Oracle 分割槽表的建立Oracle
- Oracle 建立分割槽表Oracle
- 簡單ORACLE分割槽表、分割槽索引Oracle索引
- oracle 11g 分割槽表建立(年月日周時分秒)Oracle
- oracle實用sql(14)--查詢分割槽表的分割槽列和子分割槽列OracleSQL
- mysql幾種表分割槽建立案例MySql
- Oracle分割槽表基礎運維-04列表分割槽Oracle運維
- oracle partition分割槽_分割槽列為空測試(一)Oracle
- Oracle分割槽表基礎運維-07增加分割槽(3列表分割槽)Oracle運維
- oracle將表配置為分割槽表Oracle
- SAP RETAIL 如何根據分配表查到根據它建立的採購訂單?AI
- Oracle普通表修改為分割槽表的方法Oracle
- 分割槽表及分割槽索引建立示例索引
- oracle分割槽表和分割槽表exchangeOracle
- 11g新特性--基於虛擬列的分割槽
- ORACLE將不同表改為分割槽表Oracle
- oracle 線上重新定義,普通表改變分割槽表,分割槽表可以更改型別、分割槽欄位等Oracle型別
- Oracle分割槽表及分割槽索引Oracle索引
- oracle分割槽表和非分割槽表exchangeOracle
- [oracle] expdp 匯出分割槽表的分割槽Oracle
- Oracle 表分割槽Oracle
- oracle分割槽表Oracle
- oracle表分割槽Oracle
- Oracle 分割槽表Oracle
- MySQL 分割槽表 partition線上修改分割槽欄位MySql
- oracle 分割槽表move和包含分割槽表的lob moveOracle
- OceaBase 分割槽表建立技巧
- 為虛擬機器新增硬碟並進行分割槽虛擬機硬碟
- Oracle分割槽表的使用Oracle
- Oracle分割槽表的管理Oracle
- django | 根據 model 建立對應的表Django
- [間隔分割槽]Oracle10g、11g建立間隔分割槽表Oracle
- oracle9i 普通表改為分割槽表Oracle
- Oracle分割槽之五:建立分割槽索引總結Oracle索引
- Oracle 12.2之後ALTER TABLE .. MODIFY轉換非分割槽表為分割槽表Oracle
- ORACLE分割槽表管理Oracle
- oracle 建立所有分割槽索引Oracle索引