Sign InTry Free

Sequence Functions

Sequence functions in TiDB are used to return or set values of sequence objects created using the CREATE SEQUENCE statement.

Function nameFeature description
NEXTVAL() or NEXT VALUE FORReturns the next value of a sequence
SETVAL()Sets the current value of a sequence
LASTVAL()Returns the last used value of a sequence

MySQL compatibility

MySQL does not support the functions and statements for creating and manipulating sequences as defined in ISO/IEC 9075-2.

Was this page helpful?

Download PDFRequest docs changesAsk questions on DiscordEdit this page
Playground
New
One-stop & interactive experience of TiDB's capabilities WITHOUT registration.
Products
TiDB
TiDB Dedicated
TiDB Serverless
Pricing
Get Demo
Get Started
© 2024 PingCAP. All Rights Reserved.
Privacy Policy.