Oracle start Sequence from 1
database, oracle, oracle10g, sql
Solution
Simply set the minvalue to 0 as well:
CREATE SEQUENCE PATIENTS_SEQ
START WITH 0
INCREMENT BY 1
MINVALUE 0
NOCACHE
NOCYCLE;
Problem
I am maintaining a database using Oracle 10g and I would like to have a sequence that starts from 1 and increments by 1 with each additional row. I have created the following statement in order to achieve this: ``` CREATE SEQUENCE PATIENTS_SEQ START WITH 1 INCREMENT BY 1 NOMINVALUE NOCACHE NOCYCLE; ``` However, upon inserting the first entry into the table with value (PATIENTS_SEQ.NEXTVAL), the count starts at 2 instead of 1. If I modify my sequence to start with 0, then I get an error that the start with value cannot be less than the minvalue. Can anyone help troubleshoot how to get my count to start properly from 1?