©SQL :: Manager
HomeProgram InformationTechnical detailsFree downloadDonate for a cup of coffee
This website works better with Javascript
The MyWAY SQL Manager can be downloaded here for free: as PHP installation file as GZIP file as ZIP archive
If the download from this page does not work, you can also download the program here (Virus checked at heise.de).
By downloading you accept the General Terms and Conditions
The program MyWAY SQL-Manager only works with Javascript
myway SQL Manager for MySQL and MariaDB, Download on Uptodown
SQL functionMariaDB

MariaDB NEXTVAL SQL Function - NEXT VALUE FOR Sequence

NEXTVALSyntax:NEXTVAL(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

 1
 2
 3
 4

select nextval(`my_sequence`as result;


result
bigint(20)
20

Example 2

 1
 2
 3
 4

select NEXT VALUE FOR `my_sequence` as result;


result
bigint(20)
21
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.
MONTHMONTHNAMENAME_CONSTNEXTVALNOWNULLIFNVL

Further MySQL und MariaDB SQL Sequence functions

LASTVALLASTVAL(Sequence)
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: 2025-11-04ImprintContactTerms & conditionsPrivacy & CookiesUpdatesSitemapFacebookLinkedin©2020-2025 Heino Cunze-Fischer