SEQ1
functionsupportedCore SQL functionsReturns a sequence of monotonically increasing integers, with wrap-around. Wrap-around occurs after the largest representable integer of the integer width (1, 2, 4, or 8 byte). Important This function uses sequences to produce a unique set of increasing integers, but does not necessarily produce a gap-free sequence. When operating on a large quantity of data, gaps can appear in a sequence. If a fully ordered, gap-free sequence is required, consider using the ROW_NUMBER window function. For more details about sequences in Snowflake, see Using Sequences.
Syntax
supportedpartialnot supportednot scored
SEQ1( [0|1] )
SEQ2( [0|1] )
SEQ4( [0|1] )
SEQ8( [0|1] )
Usage notes
- If the optional sign argument is 0, the sequence continues at 0 after wrap-around. If the optional sign argument is 1, the sequence continues at the smallest representable number based on the given integer width.
- The default sign argument is 0.