©SQL :: Manager
HomeProgram InformationTechnical detailsFree downloadDonate for a cup of coffee
myway SQL Manager for MySQL and MariaDB, Download on Uptodown
SQL functionMariaDB

MariaDB NEXTVAL SQL Function - NEXT VALUE FOR Sequence

Return value:INTEGER
Function type:Sequence function
Function Description

The NEXTVAL() function generates and returns the next value in a SEQUENCE.

Synonym for "NEXT VALUE FOR sequence".

The NEXTVAL() function is available from MariaDB version 10.3.

MySQL does not support sequences and the function does not exist in this database.

Example 1


select nextval(`my_sequence`as result;


Example 2


select NEXT VALUE FOR `my_sequence` as result;

The examples were created with the MyWAY SQL manager: Download

How to use the NEXTVAL() function in MariaDB databases

In MariaDB the NEXTVAL() function is used to generate a new sequence value from a sequence object. A sequence is a database object that generates a set of unique values, typically used to generate primary key values ​​in a table, and can be useful for generating unique identifiers for data.

Further MySQL und MariaDB SQL Sequence functions

More about LASTVAL Function

SETVALSETVAL(Sequence, Value [, Reserved] [, Cycle])
More about SETVAL Function

Numeric functionsString functionsRegular ExpressionsDate and Time functions
Comparison functionsEncryption & CompressionConversion functionsNULL functions
Aggregate functionsWindow functionsJSON functionsGeometric functions
Sequence functionsInformation functionsDynamic ColumnsMiscellaneous functions
More information about the NEXTVAL SQL function: mariadb.com
Updated: 2023-09-24ImprintContactTerms & conditionsPrivacy & CookiesUpdatesSitemapFacebookLinkedinTwitterStatistics©2020-2024 Heino Cunze-Fischer