Question

Is it possible to rename more than one column in mysql database once? For example I have table Person with columns Name, Surname, Age... and I want to rename them to Person%Name, Person%Surname, Person%Age automatically.

Était-ce utile?

La solution

Syntax :

   ALTER TABLE "table_name"
    Change "column 1" "column 1" ["Data Type"],
    Change "column 2" "column 2" ["Data Type"],
    Change "column 3" "column 3" ["Data Type"],
    ........

Example :

ALTER TABLE MEMBERS CHANGE name First Name CHAR(100), Surname new_Surname INT;

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top