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

Sequnce generated column in Volatile table - response (4) by bala2121

$
0
0

Hi Harpeet/Dieter,
I have created a volatile table with a column rwid declared for rowid insertion.
 
- I cannot use Identity column as it may result in gaps and its a volatile table too. 
- Use of CSUM is not recommended since it may affect the performance.
- ROW_NUMBER is not decisive as the columns in order by clause are not concluded.
I tried
 'Insert into table1(col1,col2,....rwid) 
SELECT  a.col1,
a.col2,
...
1+(SELECT MAX(rwid) FROM table1)
FROM table2 a '
 Its a Insert select statement.
Since MAX(rwid) returns null in case of no records in the table1 (initially), further additions result in null values only. Please suggest a possible solution on this.


Viewing all articles
Browse latest Browse all 14773

Trending Articles



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