Monday, January 8, 2007

Sequences in MySQL

Auto_increment serves as a parallel to Sequences in MySQL.
But auto_increment has some limitations compared to its counterpart in Oracle.

  • AUTO_INCREMENT is limited to one column per table
  • AUTO_INCREMENT must be assigned to a specific table.column (not allowing multi table use)
  • AUTO_INCREMENT is INSERTed as a not specified column, or a value of NULL

Even if a row is deleted, the sequence wont be reset to its previous value.

No comments: