云数据库 GAUSSDB-CREATE TABLE:语法格式
时间:2024-12-19 14:11:35
语法格式
- 创建表。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UN LOG GED ] TABLE [ IF NOT EXISTS ] table_name { ( { column_name data_type [ CHARACTER SET | CHARSET charset ] [ compress_mode ] [ COLLATE collation ] [ column_constraint [ ... ] ] | table_constraint | LIKE source_table [ like_option [...] ] } [, ... ] ) | LIKE source_table } [ table_option [ [ , ] ... ] ] [ htap_option ] [ WITH ( {storage_parameter = value} [, ... ] ) ] [ ON COMMIT { PRESERVE ROWS | DELETE ROWS } ] [ ILM ADD POLICY ROW STORE COMPRESS ADVANCED ROW AFTER n { day | month | year } OF NO MODIFICATION [ ON ( EXPR )]] [ TABLESPACE tablespace_name ] [ DISTRIBUTE BY { REPLICATION | HASH ( column_name [, ...] ) | MURMURHASH ( expression ) | KMEANS ( column_name ) distance_type | RANGE ( column_name [, ...] ) { SLICE REFEREN CES tablename | ( slice_less_than_item [, ...] ) | ( slice_start_end_item [, ...] ) } | LIST ( column_name [, ...] ) { SLICE REFERENCES tablename | ( slice_values_item [, ...] ) } } ] [ TO { GROUP groupname | NODE ( nodename [, ... ] ) } ];
- 其中table_option为:
{ COMMENT [ = ] 'string' | AUTO_INCREMENT [ = ] value | [ DEFAULT ] CHARACTER SET | CHARSET [ = ] default_charset | [ DEFAULT ] COLLATE [ = ] default_collation | ENGINE [ = ] { InnoDB | 'InnoDB' | "InnoDB" } }
- 其中htap_option为:
{ COLVIEW [ PRIORITY { HIGH | LOW | NONE } ] | NOCOLVIEW [ PRIORITY { HIGH | LOW | NONE } ]}
- 其中列约束column_constraint为:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
[ CONSTRAINT constraint_name ] { NOT NULL | NULL | CHECK ( expression ) | DEFAULT default_expr | ON UPDATE update_expr | GENERATED ALWAYS AS ( generation_expr ) [STORED] | AUTO_INCREMENT | COMMENT 'string' | COLVIEW | NOCOLVIEW | UNIQUE [KEY] index_parameters | PRIMARY KEY index_parameters | ENCRYPTED WITH ( COLUMN_ENCRYPTION_KEY = column_encryption_key, ENCRYPTION_TYPE = encryption_type_value ) | REFERENCES reftable [ ( refcolumn ) ] [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE action ] [ ON UPDATE action ] } [ DEFERRABLE | NOT DEFERRABLE | INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
- 其中列的压缩可选项compress_mode为:
1
{ DELTA | PREFIX | DICTIONARY | NUMSTR | NOCOMPRESS }
- 其中表约束table_constraint为:
1 2 3 4 5 6
[ CONSTRAINT [ constraint_name ] ] { CHECK ( expression ) | UNIQUE [ index_name ] [ USING method ] ( { { column_name [ ( length ) ] | ( expression ) } [ ASC | DESC ] }[, ... ] ) index_parameters | PRIMARY KEY [ USING method ] ( { column_name [ ASC | DESC ] } [, ... ] ) index_parameters [ DEFERRABLE | NOT DEFERRABLE | INITIALLY DEFERRED | INITIALLY IMMEDIATE ] { [ COMMENT 'string' ] [ ... ] }
- 其中like选项like_option为:
1
{ INCLUDING | EXCLUDING } { DEFAULTS | GENERATED | CONSTRAINTS | INDEXES | STORAGE | COMMENTS | PARTITION | RELOPTIONS | DISTRIBUTION | UPDATE | ILM | ALL }
- 其中索引参数index_parameters为:
1 2
[ WITH ( {storage_parameter = value} [, ... ] ) ] [ USING INDEX TABLESPACE tablespace_name ]
- 其中距离参数distance_type为:
1
{ L2 | COSINE | HAMMING }
- 其中RANGE分布规则
slice_less_than_item为: SLICE name VALUES LESS THAN ({ expression | MAXVALUE } [, ...]) [ DATANODE datanode_name | ( datanode_name_list [, ... ] ) ] slice_start_end_item为: SLICE name { { START ( expression ) END ( expression ) EVERY ( expression ) } | { START ( literal ) END ( { literal | MAXVALUE } ) } | { START ( literal ) } | { END ( { literal | MAXVALUE } ) } }
- 其中LIST分布规则slice_values_item为:
[ ( SLICE name VALUES (expression [, ... ]) [DATANODE datanode_name | ( datanode_name_list )] [, ... ] ) | ( SLICE name VALUES (DEFAULT) [DATANODE datanode_name] | ( datanode_name_list ) ) ]
- 其中update_expr为:
{ CURRENT_TIMESTAMP | LOCALTIMESTAMP | NOW() }
- 其中table_option为:
support.huaweicloud.com/distributed-devg-v8-gaussdb/gaussdb-12-0567.html
看了此文的人还看了
CDN加速
GaussDB
文字转换成语音
免费的服务器
如何创建网站
域名网站购买
私有云桌面
云主机哪个好
域名怎么备案
手机云电脑
SSL证书申请
云点播服务器
免费OCR是什么
电脑云桌面
域名备案怎么弄
语音转文字
文字图片识别
云桌面是什么
网址安全检测
网站建设搭建
国外CDN加速
SSL免费证书申请
短信批量发送
图片OCR识别
云数据库MySQL
个人域名购买
录音转文字
扫描图片识别文字
OCR图片识别
行驶证识别
虚拟电话号码
电话呼叫中心软件
怎么制作一个网站
Email注册网站
华为VNC
图像文字识别
企业网站制作
个人网站搭建
华为云计算
免费租用云托管
云桌面云服务器
ocr文字识别免费版
HTTPS证书申请
图片文字识别转换
国外域名注册商
使用免费虚拟主机
云电脑主机多少钱
鲲鹏云手机
短信验证码平台
OCR图片文字识别
SSL证书是什么
申请企业邮箱步骤
免费的企业用邮箱
云免流搭建教程
域名价格
推荐文章
- GaussDB数据库SQL语法_SQL语法_CREATE_ALTER
- BPM流程_BPM的书写格式_BPM产品介绍
- GaussDB版本查询_华为云GaussDB的作用_高斯数据库版本查询_华为云
- GaussDB(DWS)常用SQL_常用SQL命令_SQL语法
- 日志分析_日志结构化_日志格式化
- 什么是Flink OpenSource SQL_数据湖探索_Flink OpenSource SQL
- 连接RDS for MySQL数据库_华为云数据库RDS_语法_数据库连接_连接命令
- GaussDB数据库产品特性_华为gaussdb_高斯语法
- GaussDB(for MySQL)并行查询_GaussDB(for MySQL)内核_GaussDB(for MySQL)并行执行_PQ
- GaussDB主键生成_GaussDB存储过程_高斯数据库主键生成_华为云