![]() |
|
Archives of the TeradataForumMessage Posted: Wed, 15 Mar 2006 @ 22:27:21 GMT
try something like this -
insert into table (col1, col2, . . .)
select vt.max_id + row_number() over(order by ' ') surrogate_key, . .
from source_table a
cross join
(select coalesce(max(surrogate_key),0) max_id
from target_table) VT
Wayne Schachtel
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||