IntermediateBasic SELECT
Use a Sequence
The query
SQL
SELECT nextval('order_number_seq');
SELECT currval('order_number_seq');Note
“nextval() increments and returns the next number. currval() returns the last number generated in your current session.