Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

teradata SQL sequence generation - response (1) by Harpreet Singh

$
0
0
 INSERT INTO xref_subject_area
 SEL 
  ( SEL MAX(subject_area_Id) AS mx FROM xref_subject_area) +
 ROW_NUMBER () OVER ( ORDER BY subject_area_Nm),
 subject_area_Nm, subject_area_Nm||' desc' FROM detail_stg
 WHERE subject_area_Nm  NOT IN ( SELECT subject_area_Nm FROM xref_subject_area)

Hi Murali,
This will be what you can use. Your post is not clear on what columns are basis of sequence ordering so I have ordered them by subject name.
Thanks


Viewing all articles
Browse latest Browse all 27759

Trending Articles



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