Selecting Next Val From Sequence
Examples
Create an ascending sequence called serial, starting at 101:
CREATE SEQUENCE serial START 101;
Select the next number from this sequence:
SELECT nextval('serial');
nextval
---------
101
Select the next number from this sequence:
SELECT nextval('serial');
nextval
---------
102
|