Sample Header Ad - 728x90

Greenplum add a column to table and insert value to it in incremental order

1 vote
1 answer
563 views
I have a table st.student like following, which has one column. | STUDENT_ID| |:--------| | 100001 | | 100002 | | 100003 | | 100004 | | 100005 | | 100006 | I need to insert a column to this and values in it should be incremental one. Like the following. Note that NEW_STUDENT_ID can start from any value. Once it starts, it's continuous. What's the query for this ? | STUDENT_ID | NEW_STUDENT_ID | |:--------|:---------| | 100001 | 349009 | | 100002 | 349010 | | 100003 | 349011 | | 100004 | 349012 | | 100005 | 349013 | | 100006 | 349014 |
Asked by Shankar (13 rep)
May 9, 2022, 01:34 PM
Last activity: May 9, 2022, 02:08 PM