Greg's Blog

helping me remember what I figure out

AUTO INCREMENT

| Comments

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 [/sql]

UPDATE

I have also recently found out that the following works just as well: [sql]ALTER TABLE `aggregatedWeekly` AUTO_INCREMENT=1[/sql]