Doris的一些进阶用法

您所在的位置:网站首页 数据库如何修改表名称 Doris的一些进阶用法

Doris的一些进阶用法

2024-07-08 01:23| 来源: 网络整理| 查看: 265

SQLALTER TABLE base_table_name RENAME ROLLUP old_rollup_name new_rollup_name;

mysql> desc ex_user all; +-----------------+---------------+-----------------+-------------+------+-------+---------------------+---------+---------+ | IndexName       | IndexKeysType | Field           | Type        | Null | Key   | Default             | Extra   | Visible | +-----------------+---------------+-----------------+-------------+------+-------+---------------------+---------+---------+ | ex_user         | AGG_KEYS      | user_id         | LARGEINT    | No   | true  | NULL                |         | true    | |                 |               | date            | DATE        | No   | true  | NULL                |         | true    | |                 |               | city            | VARCHAR(20) | Yes  | true  | NULL                |         | true    | |                 |               | age             | SMALLINT    | Yes  | true  | NULL                |         | true    | |                 |               | sex             | TINYINT     | Yes  | true  | NULL                |         | true    | |                 |               | last_visit_date | DATETIME    | Yes  | false | 1970-01-01 00:00:00 | REPLACE | true    | |                 |               | cost            | BIGINT      | Yes  | false | 0                   | SUM     | true    | |                 |               | max_dwell_time  | INT         | Yes  | false | 0                   | MAX     | true    | |                 |               | min_dwell_time  | INT         | Yes  | false | 99999               | MIN     | true    | |                 |               |                 |             |      |       |                     |         |         | | rollup_ucd_cost | AGG_KEYS      | user_id         | LARGEINT    | No   | true  | NULL                |         | true    | |                 |               | city            | VARCHAR(20) | Yes  | true  | NULL                |         | true    | |                 |               | date            | DATE        | No   | true  | NULL                |         | true    | |                 |               | cost            | BIGINT      | Yes  | false | 0                   | SUM     | true    | |                 |               |                 |             |      |       |                     |         |         | | rollup_u_cost   | AGG_KEYS      | user_id         | LARGEINT    | No   | true  | NULL                |         | true    | |                 |               | cost            | BIGINT      | Yes  | false | 0                   | SUM     | true    | +-----------------+---------------+-----------------+-------------+------+-------+---------------------+---------+---------+

ALTER TABLE ex_user RENAME ROLLUP rollup_u_cost new_rollup_u_cost;

mysql> desc ex_user all; +-------------------+---------------+-----------------+-------------+------+-------+---------------------+---------+---------+ | IndexName         | IndexKeysType | Field           | Type        | Null | Key   | Default             | Extra   | Visible | +-------------------+---------------+-----------------+-------------+------+-------+---------------------+---------+---------+ | ex_user           | AGG_KEYS      | user_id         | LARGEINT    | No   | true  | NULL                |         | true    | |                   |               | date            | DATE        | No   | true  | NULL                |         | true    | |                   |               | city            | VARCHAR(20) | Yes  | true  | NULL                |         | true    | |                   |               | age             | SMALLINT    | Yes  | true  | NULL                |         | true    | |                   |               | sex             | TINYINT     | Yes  | true  | NULL                |         | true    | |                   |               | last_visit_date | DATETIME    | Yes  | false | 1970-01-01 00:00:00 | REPLACE | true    | |                   |               | cost            | BIGINT      | Yes  | false | 0                   | SUM     | true    | |                   |               | max_dwell_time  | INT         | Yes  | false | 0                   | MAX     | true    | |                   |               | min_dwell_time  | INT         | Yes  | false | 99999               | MIN     | true    | |                   |               |                 |             |      |       |                     |         |         | | rollup_ucd_cost   | AGG_KEYS      | user_id         | LARGEINT    | No   | true  | NULL                |         | true    | |                   |               | city            | VARCHAR(20) | Yes  | true  | NULL                |         | true    | |                   |               | date            | DATE        | No   | true  | NULL                |         | true    | |                   |               | cost            | BIGINT      | Yes  | false | 0                   | SUM     | true    | |                   |               |                 |             |      |       |                     |         |         | | new_rollup_u_cost | AGG_KEYS      | user_id         | LARGEINT    | No   | true  | NULL                |         | true    | |                   |               | cost            | BIGINT      | Yes  | false | 0                   | SUM     | true    | +-------------------+---------------+-----------------+-------------+------+-------+---------------------+---------+---------+



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3