简体   繁体   中英

MySQL alter All Columns In table

I have 4 tables.There are columns in each table which have identical names. Each table has for instance, "id" column.

These make for terrible arrays in PHP.

The solution to my trouble is to prepend column names with the name of the table.

Is there a MySQL statement which would add "name" to the start of every column in name the table? So that the id field in people table would become peopleid , for instance.

选择后,可以为该列指定别名。

SELECT id AS 'PeopleID' FROM People

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM