DelphiFAQ Home Search:
General :: Databases :: mysql
General information about mysql - how to get around the differences between version 3.33 an 4, how to do stuff that you think you need a nested query for etc.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

Modifying a field to be auto_increment

Question:

I need to modify my primary key to be an auto_increment field.

Answer:

For some reason

Table name: T1, primary key field name: F1

alter table T1 change F1 F1 integer not null auto_increment;

will work, but

alter table T1 change F1 F1 integer not null auto_increment primary key;

does not work. However, after statement #1 the field F1 will still be the primary key. This was observed in mysql 4.0


Generated 12:00:35 on May 24, 2017