NEXT is a reserved keyword in the SQL standard that signals the request for the immediately succeeding element in an ordered context. It most commonly appears in two constructs: 1) FETCH NEXT, which advances a cursor or result-set window by a specified number of rows (default 1), and 2) NEXT VALUE FOR, which obtains the next numeric value from a defined sequence object. Because NEXT is positional, its behavior depends on the surrounding clause. For cursors, it moves the cursor pointer forward. For sequences, it increments and returns the sequence counter. NEXT cannot be used standalone; it must be paired with FETCH or VALUE FOR. Misplacing it or omitting required keywords causes syntax errors. Although implementations differ slightly, the semantic purpose remains: obtain the next item in a series.
FETCH, OFFSET, FIRST, CURSOR, SEQUENCE, NEXTVAL, LIMIT
SQL:2008 added OFFSET ... FETCH NEXT; ISO SQL:2011 formalized NEXT VALUE FOR sequences
Both return rows for pagination. FIRST is typically used for the initial page, whereas NEXT is used for subsequent pages but they are functionally identical in most engines.
No. Sequence objects are designed for high concurrency and supply values without row-level locks, though gaps can occur if a transaction rolls back.
No. NEXT must follow FETCH or precede VALUE FOR inside the appropriate clause. Using it elsewhere triggers a syntax error.
An empty result is returned and most APIs set the NOT FOUND condition or rowcount to zero, indicating no more rows.