on-internet
← Community

Oracle Sequence NEXTVAL not in order?

Stack Overflow ·

I have a simple sequence, like this: CREATE SEQUENCE my_sequence START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE; I'm trying to insert something, and I'm using the sequence like this: INSERT INTO table1(col0, col1, col2, col3, col4, col5) SELECT my_sequence.NEXTVAL, col1, col2, col3, col4, col5 FROM ( SELECT tt.col1, tt.col2, tt.col3, tt.col4, sx.col5, FROM table2 tt LEFT JOIN table3 sx ON tt.col6 = sx.col6 WHERE sx.col5 LIKE 'P%' ORDER BY tt.col1 ASC ); Now, when I see the table1 contents, they are not ordered as expected. If I order it by col1, the numbers in col0 show: col0 col1 col2 1 1 ... 2

Comments

Sign in or sign up to comment and upvote.

No comments yet.