Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Surrogate Key Question - response (1) by KS42982

$
0
0

You can try something like below -

SEL CSUM(1,(ADDR.ADDRESS_LINE1 || ADDR.ADDRESS_LINE2 || ..) ) + DT.MAX_ADDRESS_ID AS ADDRESS_ID
FROM SOURCE.ADDRESS_TABLE ADDR,
(SEL ZEROIFNULL(MAX(ADDRESS_ID)) MAX_ADDRESS_ID FROM TARGET.ADDRESS_TABLE) DT

WHERE (ADDR.ADDRESS_LINE1 || ADDR.ADDRESS_LINE2 || ..) NOT IN
(SEL (ADDR.ADDRESS_LINE1 || ADDR.ADDRESS_LINE2 || ..) FROM TARGET.ADDRESS_TABLE) ;


Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>