Snowflake generate sequence without gaps
This example shows how to use ROW_NUMBER to generate a sequence without gaps:
select row_number() over (order by seq4()) from table(generator(rowcount => 10)); +-------------------------------------+ | ROW_NUMBER() OVER (ORDER BY SEQ4()) | |-------------------------------------| | 1 | | 2 | | 3 | | 4 | | 5 | | 6 | | 7 | | 8 | | 9 | | 10 | +-------------------------------------+