Hi Nishant,
any IDENTITY/system-maintained sequence may result in gaps (due to restarts or rollbacks), but in Teradata it's not one sequence it's multiple parallel sequences, thus there are always gaps.
Without gaps is only possible with ROW_NUMBER plus
- a table maintaining the highest used value used in a transaction, in best case in a SP
- or ROW_NUMBER + (SELECT COALESCE(MAX(value),0) FROM tab)
Dieter
Hi Nishant,
any IDENTITY/system-maintained sequence may result in gaps (due to restarts or rollbacks), but in Teradata it's not one sequence it's multiple parallel sequences, thus there are always gaps.
Without gaps is only possible with ROW_NUMBER plus
- a table maintaining the highest used value used in a transaction, in best case in a SP
- or ROW_NUMBER + (SELECT COALESCE(MAX(value),0) FROM tab)
Dieter