CREATE SEQUENCE
Create a sequence generator. This statement initializes a sequence object that produces a series of unique numeric values on demand.
Syntax
CREATE [OR REPLACE] [TEMPORARY] SEQUENCE [IF NOT EXISTS] sequence_name
[AS { TINYINT | SMALLINT | |MEDIUMINT | INT | INTEGER | BIGINT } [SIGNED | UNSIGNED]]
[ INCREMENT [ BY | = ] number ]
[ MINVALUE [=] number | NO MINVALUE | NOMINVALUE ]
[ MAXVALUE [=] number | NO MAXVALUE | NOMAXVALUE ]
[ START [ WITH | = ] number ]
[ CACHE [=] number | NOCACHE ] [ CYCLE | NOCYCLE]
[table_options](../sql-statements/data-definition/create/create-table.md#table-options)Description
CREATE Options
AS
INCREMENT
MINVALUE
MAXVALUE
START
CACHE / NOCACHE
CYCLE / NOCYCLE
Constraints on Create Arguments
Atomic DDL
Examples
Cache
Create table with a sequence as a default value
See Also
Last updated
Was this helpful?

