Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Sequence with Select Query

651883Nov 4 2009 — edited Nov 4 2009
Hi, is it possible to create a sequence by using a Select Query for START WITH criteria. Basically, records are already existing and I want to create sequence START with from the last no. of ID+1.

e.g. -

CREATE SEQUENCE seq_id INCREMENT BY 1
START WITH (SELECT Decode(MAX(ID),'',1,MAX(ID)) + 1 FROM Table1)

Is this possible?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 2 2009
Added on Nov 4 2009
6 comments
914 views