云数据库 GAUSSDB-CREATE AGGREGATE:语法格式

时间:2024-11-02 18:45:37

语法格式

CREATE AGGREGATE name ( input_data_type [ , ... ] ) (
    SFUNC = sfunc,
    -- SFUNC1 = sfunc, // 过时的写法,等同于SFUNC = sfunc
    STYPE = state_data_type
    -- STYPE1 = state_data_type, // 过时的写法,等同于STYPE = state_data_type
    [ , FINALFUNC = ffunc ]
    [ , INITCOND = initial_condition ]
    -- [ , INITCOND1 = initial_condition ] // 过时的写法,等同于INITCOND = initial_condition
    [ , SORTOP = sort_operator ]
    [ , CFUNC = collection_func ]
    [ , INITCOLLECT = initial_collection_condition ]
    [ , IFUNC = init_func ]
    [ , SHIPPABLE = is_shippable ]
);

or the old syntax

CREATE AGGREGATE name (
    BASETYPE = base_type,
    SFUNC = sfunc,
    -- SFUNC1 = sfunc, // 过时的写法,等同于SFUNC = sfunc
    STYPE = state_data_type
    -- STYPE1 = state_data_type, // 过时的写法,等同于STYPE = state_data_type
    [ , FINALFUNC = ffunc ]
    [ , INITCOND = initial_condition ]
    -- [ , INITCOND1 = initial_condition ] // 过时的写法,等同于INITCOND = initial_condition
    [ , SORTOP = sort_operator ]
    [ , CFUNC = collection_func ]
    [ , INITCOLLECT = initial_collection_condition ]
    [ , IFUNC = init_func ]
);
support.huaweicloud.com/centralized-devg-v8-gaussdb/gaussdb-42-0543.html