DB2 create partitioned table
在Z上和开放平台上的创建方法还不太一样,两套人马开发出来的就是牛!
蛋疼……
贴不同类型的几个例子感受一下,Z上的ASC,DESC不见了:
CREATE TABLE foo(a INT)
PARTITION BY RANGE (a) (STARTING FROM (1)
ENDING AT (100) EVERY (20))
CREATE TABLE lineitem (
l_orderkey DECIMAL(10,0) NOT NULL,
l_quantity DECIMAL(12,2),
l_shipdate DATE,
l_year_month INT GENERATED ALWAYS AS (YEAR(l_shipdate)*100 + MONTH(l_shipdate)))
PARTITION BY RANGE(l_shipdate)
(STARTING ('1/1/1992') ENDING ('12/31/1992') EVERY 1 MONTH);
CREATE TABLE t(a INT, b INT)
PARTITION BY RANGE(b) (STARTING FROM (1)
EXCLUSIVE ENDING AT (1000) EVERY (100))
CREATE TABLE lineitem2 (
l_orderkey DECIMAL(10,0) NOT NULL,
l_quantity DECIMAL(12,2),
l_shipdate TIMESTAMP,
l_year_month INT GENERATED ALWAYS AS (YEAR(l_shipdate)*100 + MONTH(l_shipdate)))
PARTITION BY RANGE(l_shipdate)
(STARTING ('1992-01-01-00.00.00.000000') ENDING ('1992-12-31-23.59.59.999999') EVERY 1 MONTH)
CREATE TABLE lineitem3 (
l_orderkey DECIMAL(10,0) NOT NULL,
l_quantity DECIMAL(12,2),
l_shipdate TIMESTAMP,
l_year_month INT GENERATED ALWAYS AS (YEAR(l_shipdate)*100 + MONTH(l_shipdate)))
PARTITION BY RANGE(l_shipdate)
(STARTING ('1/1/1992') ENDING ('12/31/1992') EVERY 1 MONTH)
CREATE TABLE sales(invoice_date date, inv_month int NOT NULL
GENERATED ALWAYS AS (month(invoice_date)), inv_year INT NOT
NULL GENERATED ALWAYS AS ( year(invoice_date)),
item_id int NOT NULL,
cust_id int NOT NULL) PARTITION BY RANGE (inv_year,
inv_month)
(PART Q1_02 STARTING (2002,1) ENDING (2002, 3) INCLUSIVE,
PART Q2_02 ENDING (2002, 6) INCLUSIVE,
PART Q3_02 ENDING (2002, 9) INCLUSIVE,
PART Q4_02 ENDING (2002,12) INCLUSIVE,
PART CURRENT ENDING (MAXVALUE, MAXVALUE));
CREATE TABLE foo(a INT)
PARTITION BY RANGE(a)
(STARTING FROM (1) ENDING AT (100),
STARTING FROM (201) ENDING AT (300))
DB2 create partitioned table的更多相关文章
- DB2 create tablespace
db2手工创建表空间 db2 v10.11.1 创建系统管理使用文件目录的表空间 db2 "create tablespace newtbs01 managed by system usin ...
- How To Convert A Partitioned Table To A Non-Partitioned Table Using DataPump In 11g (Doc ID 1276049.1)
How To Convert A Partitioned Table To A Non-Partitioned Table Using DataPump In 11g (Doc ID 1276049. ...
- ORA-14404: partitioned table contains partitions in a different tablespace
SQL> drop tablespace nn_data including contents and datafiles; drop tablespace nn_data including ...
- when create a table,then show error ora-00952 tablespace tsb_1 not exist
QUESTION:When create a table,then show error ora-00952 tablespace tsb_1 not exist. STEP: 1.select us ...
- IDEA的SonarLint插件报错Unable to create symbol table for
执行sonarLint 报错: Unable to create symbol table for ***File won't be refreshed because there were erro ...
- SonarQube执行代码分析时,报错ERROR: Unable to create symbol table for : /**/*.java java.lang.IllegalArgumentException: Unsupported class file major version 55
若要转载本文,请务必声明出处:https://www.cnblogs.com/zhongyuanzhao000/p/11686633.html 起因: 最近正在尝试SonarQube的简单使用,但是当 ...
- ORA-31633:unable to create master table "DP.SYS_EXPORT_FULL_11" ORA-01658
问题描述:在进行数据泵进行数据库备份的时候,但是导出命令报错,环境是19C 4节点的rac 一体机.目前磁盘空间需要清理,清理之前先备份一下数据库 ORA-31626:job does not exi ...
- db2 xml 转 table【XQuery系列】
版本号:DB2 Version 9.1 1.创建測试表,初始化数据 create table emp (doc XML); INSERT INTO EMP VALUES ('<dept bl ...
- db2 xml 转 table
版本:DB2 Version 9.1 1.创建测试表,初始化数据 create table emp (doc XML); INSERT INTO EMP VALUES ('<dept bldg= ...
随机推荐
- laravel中间件-----------middleware
middleware中间件 是访问到达服务器后在被对应的路由处理之前所经过的一层过滤层,故称中间件. 中间件是存放在app\http\middleware中,需要定一个 handle 处理方法,在ha ...
- HDU 5120 A Curious Matt(2014北京赛区现场赛A题 简单模拟)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5112 解题报告:扫一遍 #include<cstdio> #include<cstr ...
- ORA-14402: 更新分区关键字列将导致分区的更改
默认情况下,oracle的分区表对于分区字段是不允许进行update操作的,如果有对分区字段行进update,就会报错——ORA-14402: 更新分区关键字列将导致分区的更改.這種情況可以通過開啟表 ...
- 剑指Offer 和为S的两个数字
题目描述 输入一个递增排序的数组和一个数字S,在数组中查找两个数,使得他们的和正好是S,如果有多对数字的和等于S,输出两个数的乘积最小的. 输出描述: 对应每个测试案例,输出两个数,小的先输出. 思路 ...
- django初始
创建django工程 django-admin startproject [工程名称] mysite - mysite # 对整个程序进行配置 - init - settings # 配置文件 - u ...
- django的中间件
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA2EAAAGUCAIAAAAzrr3rAAAgAElEQVR4nOy9d5wcx3kmzAXl80m6zy
- 2小时入门Robot Framework
1.介绍 1.1.介绍Robot Robot Framework是一个基于关键字驱动的自动化测试框架.通过该框架,测试人员可使用python封装关键字,并在非代码环境下使用关键字构建可被执行的测试用例 ...
- 手动安装python后,交互模式下退格键乱码
没有安装readline相关的模块 yum install readline readline-devel 再重新变异安装python就可以了
- 基于NHibernate的开发框架的设计
上次的 NHibernate的Session管理策略和NHibernateHelper 发布并提供下载,给NHibernate刚入门的同学们带来很多便利. 最近有同学在求NH的通用仓储,正好我最近也设 ...
- ajax删除数据后刷新页面
代码如图: 理解: 发送请求后删除name 属性为 name 的data;用rem .remove删除: 删除后找到页面上app的数量:定义page = len/12+1; 找到当前页是哪一页,如果l ...