• 创建分区表



    DROP TABLE IF EXISTS "CNYB"."CT_DAY_PLANT_001";
    CREATE TABLE "CNYB"."CT_DAY_PLANT_001"(
    "ID" VARCHAR(32) NOT NULL,
    "YEAR" VARCHAR(4) NOT NULL,
    "DATE" VARCHAR(2) NOT NULL,
    "ORG_ID" VARCHAR(18) NOT NULL,
    "TYPE" INTEGER NOT NULL,
    "CTIME" VARCHAR(19),
    "V01" DECIMAL(16,4),
    "V02" DECIMAL(16,4),
    "V03" DECIMAL(16,4),
    CONSTRAINT "CT_DAY_PLANT_001_pkey" PRIMARY KEY ("YEAR","DATE", "ORG_ID", "ID", "TYPE")
    )PARTITION BY RANGE ("YEAR");


    CREATE TABLE "CNYB"."CT_DAY_PLANT_001_2019" PARTITION OF "CNYB"."CT_DAY_PLANT_001"
    FOR VALUES FROM ('2019') TO ('2020')
    ;
    CREATE TABLE "CNYB"."CT_DAY_PLANT_001_2020" PARTITION OF "CNYB"."CT_DAY_PLANT_001"
    FOR VALUES FROM ('2020') TO ('2021')
    ;
    CREATE TABLE "CNYB"."CT_DAY_PLANT_001_2021" PARTITION OF "CNYB"."CT_DAY_PLANT_001"
    FOR VALUES FROM ('2021') TO ('2022')
    ;
    CREATE TABLE "CNYB"."CT_DAY_PLANT_001_2022" PARTITION OF "CNYB"."CT_DAY_PLANT_001"
    FOR VALUES FROM ('2022') TO ('2023')
    ;
    CREATE TABLE "CNYB"."CT_DAY_PLANT_001_2023" PARTITION OF "CNYB"."CT_DAY_PLANT_001"
    FOR VALUES FROM ('2023') TO ('2024')
    ;
    CREATE TABLE "CNYB"."CT_DAY_PLANT_001_2024" PARTITION OF "CNYB"."CT_DAY_PLANT_001"
    FOR VALUES FROM ('2024') TO ('2025')
    ;
    CREATE TABLE "CNYB"."CT_DAY_PLANT_001_2025" PARTITION OF "CNYB"."CT_DAY_PLANT_001"
    FOR VALUES FROM ('2025') TO ('2026')
    ;

  • 相关阅读:
    c语言 ,回调函数[个人理解]
    MFC、C++ 、Windows编程高手
    c++, 虚基派生 : 共同基类产生的二义性的解决办法
    c++,命名空间(namespace)
    c++,纯虚函数与抽象类
    c++ ,protected 和 private修饰的构造函数
    c++ 虚析构函数[避免内存泄漏]
    c++,虚函数
    c++,类的组合
    GPU与CPU的区别
  • 原文地址:https://www.cnblogs.com/testzcy/p/12826161.html
Copyright © 2020-2023  润新知