02 June 2018        Add to Favorites   Report

Generate a sequential number for each row while inserting - Teradata

Scenario:

Create a unique row number for each row and then insert the data in to the target table

Solution:

select

row_number() over(order by a.ts desc) as insert_num ,col1 ,col2 ,col3 from a
Copied