Skip to content

Latest commit

 

History

History
55 lines (37 loc) · 1.73 KB

sql-statement-show-create-sequence.md

File metadata and controls

55 lines (37 loc) · 1.73 KB
title summary aliases
SHOW CREATE SEQUENCE
TiDB 数据库中 SHOW CREATE SEQUENCE 的使用概况。
/docs-cn/dev/sql-statements/sql-statement-show-create-sequence/
/docs-cn/dev/reference/sql/statements/show-create-sequence/

SHOW CREATE SEQUENCE

SHOW CREATE SEQUENCE 语句用于查看一个序列的详细信息,类似于 SHOW CREATE TABLE 语句。

语法图

ShowCreateSequenceStmt:

ShowCreateSequenceStmt

TableName:

TableName

示例

{{< copyable "sql" >}}

CREATE SEQUENCE seq;
Query OK, 0 rows affected (0.03 sec)

{{< copyable "sql" >}}

SHOW CREATE SEQUENCE seq;
+-------+----------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                               |
+-------+----------------------------------------------------------------------------------------------------------------------------+
| seq   | CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB |
+-------+----------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

MySQL 兼容性

MySQL 暂无序列选项。TiDB 序列部分借鉴自 MariaDB。SETVAL 函数的步调是 TiDB 特有的,其他函数的步调与 MariaDB 保持一致。

另请参阅