How to change or rename a column name for a table in mysql? - Mysql Views : 710
Tagged in : Mysql
Send mail vote down 0 vote down 0
Changing or renaming particular column name or field name for a table

Change keyword is used to alter an existing column in a MySQL table.
You can use change to rename a column by specifying both the old column name, and the new column name.

ie,
mysql> alter table [table name] change [old column name] [new column name] description;

for example,
mysql> alter table test change id Customer-id bigint(20);

Above query will change the column name from id to Customer-id.

By - Ramya, On - 2008-07-03




    Login to add Comments .