Difference between revisions of "Move mysql column"

From Conservapedia
Jump to navigation Jump to search
(This command will move your id column to the first position in a MySQL table)
 
(changed "donors" to "tablename" so it's more clear how to apply this. i don't know mysql well, so please fix if i screwed up!)
Line 1: Line 1:
alter table donors modify `id` int(10) unsigned NOT NULL AUTO_INCREMENT first;
+
alter table tablename modify `columnname` int(10) unsigned NOT NULL AUTO_INCREMENT first;

Revision as of 19:59, December 15, 2009

alter table tablename modify `columnname` int(10) unsigned NOT NULL AUTO_INCREMENT first;