I want to create a sequence in oracle where the max value of the column field (Empid) must be the min value of the sequence.
The below was the one i found in our same stackexchange
create sequence mytemp_seq start with &v_Startval;
This command prompts me to enter the max value of teh column name which i have to enter.
How can I fix the value of &v_startval with out it prompting ,but directly setting the values from the below statement
select max(empid) from mytemp..
I am trying like this below
create sequence mytemp_seq start with (SELECT MAX(empid) from mytemp)
But it doesnt work.
You could do it with some PL/SQL: