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))
时间: 2024-10-06 14:52:20

DB2 create partitioned table的相关文章

How To Convert A Partitioned Table To A Non-Partitioned Table Using DataPump In 11g (Doc ID 1276049.1)

APPLIES TO: Oracle Database Exadata Cloud Machine - Version N/A and laterOracle Cloud Infrastructure - Database Service - Version N/A and laterOracle Database Cloud Exadata Service - Version N/A and laterOracle Database Exadata Express Cloud Service

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 user table tablespace. SELECT username,DEFAULT_TABLESPACE,temporary_tablespace FROM dba_users WHERE username='LJB'; 2.select user owner tablespace. SELE

db2 xml 转 table【XQuery系列】

版本:DB2 Version 9.1 1.创建测试表,初始化数据 create table emp (doc XML); INSERT INTO EMP VALUES ('<dept bldg="101">     <employee id="901">         <name>             <first>John</first>             <last>Doe<

Create User-Defined Table Type

使用 Create type 创建自定义的Table Type ,Syntax 如下,和Create Table的 语法十分相似. CREATE TYPE [ schema_name. ] type_name { FROM base_type [ ( precision [ , scale ] ) ] [ NULL | NOT NULL ] | AS TABLE ( { <column_definition> | <computed_column_definition> } [ &

CMD Create Database &amp; Table

Just do it: /* SQL 创建库 CREATE DATABASE jsp_demo DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; SQL 创建表 CREATE TABLE `news` ( `iId` SMALLINT(6) NOT NULL AUTO_INCREMENT, `iCategory` TINYINT(4) NOT NULL, `sTitle` VARCHAR(100) NOT NULL, `sDesc` VARC

ios 官网文档翻译—Create a Table View(swift)

学习IOS中,翻译一下官方文档加深理解顺便提高自己的英文能力.英文很烂,翻译如若有错请谅解. 原文地址 如何创建一个TableView 在这一课中,你要创建FoodTracker(demo app)的主界面.你将创建一个基于table view的显示用户们的食物的列表,并且将完成如下图的自定义table cells来展示用户们的每份食物. 学习目标 在学习完这一劫课程后,你应该会: 创建一个storyboard场景 了解table view的关键组成部分 创建并设计一个自定义table view

Partition table的switch条件2:Partition 的隐式Check约束 和Nullability

Partition column允许为Null,Null是最小值,存在于Partition Number=1的partition中. Any data with a NULL in the partition column will reside in the leftmost partition. NULL is considered smaller than the minimum value of the data type’s values. Partition Function 定义了

Partition table的switch条件1:结构相同(类型,nullability)

1,创建实例数据 -- create parition function CREATE PARTITION FUNCTION pf_int_Left (int) AS RANGE LEFT FOR VALUES (10,20); --create partition scheme CREATE PARTITION SCHEME PS_int_Left AS PARTITION pf_int_Left TO ([primary], [primary], [primary]); --create p

DB2 数据库权限

以下内容转载:  http://blog.csdn.net/xiyuan1999/article/details/8135263 DB2中的权限 DB2 中有三种主要的安全机制,可以帮助 DBA 实现数据库安全计划:身份验证(authentication).授权(authorization) 和特权(privilege). 身份验证是用户在尝试访问 DB2 实例或数据库时遇到的第一种安全特性.DB2 身份验证与底层操作系统的安全特性紧密协作来检验用户 ID 和密码.DB2 还可以利用 Kerbe