简体   繁体   English

一次向多个表添加新字段?

[英]Add new field to multiple table at once?

I want to add same field to multiple tables. 我想将相同的字段添加到多个表。 Can I do this with single query in MySql? 我可以在MySql中使用单个查询执行此操作吗?

I don't think you can do this with a single query, as it requires the ALTER TABLE syntax which only supports one table per query (although you could add/modify multiple columns in the same table). 我不认为你可以用一个查询来做这件事,因为它需要ALTER TABLE语法,每个查询只支持一个表(尽管你可以在同一个表中添加/修改多个列)。

You have to do one ALTER TABLE query per table to be modified. 您必须对每个表执行一次ALTER TABLE查询以进行修改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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