www.fromthevalley.com.au

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
HOME |  AJAX |  APACHE |  Bizphone |  CSS |  DNS |  General |  Graphics |  HTML |  Hardware |  Javascript |  Linux |  MAC |  MS SQL |  Mail |  Microsoft |  OFFICE 365 |  Perl |  Postgres |  SEO |  Social Media |  VMware |  Windows 10