Scalar function
The valid niladic/literal-sign form produces non-NULL values; NULL sign arguments are rejected.
Syntax
Scalar
Arguments
Returns
- Type: BIGINT
- Possible values: Sign 0 wraps through 0..4294967295; sign 1 wraps into -2147483648..2147483647.
- NULL behavior: The valid no-argument/literal-sign form produces non-NULL values; NULL sign arguments are rejected.
Properties
Usage notes
- Each sequence column has its own counter, starting at 0 for each new query.
- Which number is assigned to each row can vary with execution order. Use ORDER BY to sort the output.
- Deterministic: The sequence assigned to each row can change with execution order.
Examples
Typical behavior
- A fresh query/sequence operator; sorted output.
Limitations
- Sequence values are not a persistent database sequence and are not guaranteed gap-free after upstream/downstream filtering or LIMIT.
Last modified on October 15, 2026