AUTO INCREMENT
by gregs on Jun.29, 2006, under MySQL
Since the MySQL Query Browser on my Mac refused to let me set a field as auto increment through the GUI, here's how you can using SQL change an existing column to use auto_increment:
SQL:
-
ALTER TABLE `aggregatedWeekly` CHANGE `Id` `Id` INT( 6 ) UNSIGNED NOT NULL AUTO_INCREMENT
UPDATE
I have also recently found out that the following works just as well:
SQL:
ALTER TABLE `aggregatedWeekly` AUTO_INCREMENT=1