You Are Here Home > MySQL

MySQL

Rearrange/move MySQL Table Columns

To *move* a column to a particular position:

ALTER TABLE `user`
MODIFY COLUMN `permission` int(10)
AFTER `password`

To *move* a column to the beginning:

ALTER TABLE `user`
MODIFY COLUMN `permission` int(10)
FIRST
Rearrange/move MySQL Table Columns
Comments (0)   Filed under: MySQL   Posted by: Hamid

Add a Column To The Beginning Of a Table

Assume that we want to add a column ‘id’ in the beginning of the table ‘test’:

ALTER TABLE test ADD id INT NOT NULL FIRST;
Add a Column To The Beginning Of a Table
Comments (0)   Filed under: MySQL   Posted by: Hamid
« Newer PostsOlder Posts »