Skip to content

Latest commit

 

History

History
55 lines (37 loc) · 1.79 KB

sql-statement-show-create-sequence.md

File metadata and controls

55 lines (37 loc) · 1.79 KB
title summary aliases
SHOW CREATE SEQUENCE
An overview of the usage of SHOW CREATE SEQUENCE for the TiDB database.
/docs/dev/sql-statements/sql-statement-show-create-sequence/
/docs/dev/reference/sql/statements/show-create-sequence/

SHOW CREATE SEQUENCE

The SHOW CREATE SEQUENCE shows the detailed information of a sequence, which is similar to SHOW CREATE TABLE.

Synopsis

ShowCreateSequenceStmt:

ShowCreateSequenceStmt

TableName:

TableName

Examples

{{< copyable "sql" >}}

CREATE TABLE 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 compatibility

Currently, MySQL does not have the sequence option. The TiDB sequence is borrowed from MariaDB. Except for the SETVAL function, all other functions have the same progressions with those functions of MariaDB.

See also