10 SQL Statements and Extensions for the Salesforce Driver : Create Sequence

Create Sequence
The Create Sequence statement creates an auto-incrementing sequence for a local table.
Grammar
CREATE SEQUENCE sequence_name [AS {INTEGER | BIGINT}] [START WITH start_value] [INCREMENT BY increment_value]
where:
sequence_name specifies the name of the sequence. By default, the sequence type is INTEGER.
start_value specifies the starting value of the sequence. The default start value is 0.
increment_value specifies the value of the increment; the value must be a positive integer. The default increment is 1.
Next Value For Clause
Use the Next Value For clause to specify the next value for a sequence that is used in a Select, Insert, or Update statement.
Grammar
NEXT VALUE FOR sequence_name
where sequence_name specifies the name of the sequence from which to retrieve the value.
Example
The following example retrieves the next value or set of values in Sequence1:
SELECT NEXT VALUE FOR Sequence1 FROM Account