简体   繁体   中英

Auto Increment and sequence

I was working upon sequences and since i am new to sequences I had few doubts:

  1. Whats the difference between Sequence and Auto Increment while using in MySQL.

  2. Can i add a sequence or alter a column and change its value to auto-increment or a sequence val if the column is already created in the table(its already a primary key but no auto increment is there) or do i need to drop that column and create it again.

  3. Can i add multiple sequences for a single table's different columns ?

All helping answers will be appreciated.

Here are your answers.

Ans 1. MySQL doesn't support Sequence, so it provides the facility of Auto Incremnent.

Ans 2. Yes, without any doubt you can add the sequence or change the sequences value without dropping that column.

Ans 3. Yes. You can add multiple Sequrnces to a single table for different columns.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM