You created a table with specific column name. Sometimes you need to change the column name. At the time, you can change the field name. It is possible in mysql using by CHANGE mysql command. The following mysql query is used for this:
Now your table look like this:
Now your output look like this:
Now you will get output as No to id and Image to img.
Related Post:
Mysql Query:
Alter table table_name change old_column_name new_column_name datatype(length)
Alter table table1 change Game_name name varchar(40)
Consider the example:
table1 is name of this table.
table1 is name of this table.
Suppose you've to change the column name. The mysql query is:
Now your table look like this:
Now the column name 'Game_name' is changed into 'name'.
Changing the multiple column name at the time in mysql:
You can change multiple column name at a time in mysql. The mysql query as follow as:
Mysql Query:
Alter table table1
change No id int(5),
modify Image img varchar(40)
Now your output look like this:
Now you will get output as No to id and Image to img.
Related Post:
Add column after specific field in mysql table
Delete column in mysql table
Change column size in mysql table
Change column datatype in mysql
Change table name in mysql
Change column NOT NULL to NULL in mysql
Add primary key to existing column in mysql
how to add auto increment to existing column in mysql
How to remove auto increment from column in mysql
Delete column in mysql table
Change column size in mysql table
Change column datatype in mysql
Change table name in mysql
Change column NOT NULL to NULL in mysql
Add primary key to existing column in mysql
how to add auto increment to existing column in mysql
How to remove auto increment from column in mysql
No comments:
Post a Comment