Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to create a sequence in MySql5.0  RSS feed

 
kranthi chamarthi
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,
In oracle we can create a sequence with the following statement
'CREATE SEQUENCE GLOBAL_ID
MINVALUE 1
START WITH 1
INCREMENT BY 1;'

How to create a sequence in MySql5.0?
Thanks in advance
 
Paul Campbell
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In MySQL you either handle it programmatically or you use the auto_increment value on your column.

your_column_id INT(4) NOT NULL AUTO_INCREMENT
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 36634
475
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to our JDBC question since this isn't about Oracle.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!