Home > database >  At the same time for multiple tables of new the same field
At the same time for multiple tables of new the same field

Time:10-05

Database has some similar table, such as the table1 and table2, table3, but discontinuous (you need to determine table don't exist), need to add some of the same field to the table, what is the easy way

CodePudding user response:

In information_schema. Tables out of the table name with concat Mosaic statements

CodePudding user response:

Perform like this spell to modify SQL query, then copy the query results perform
The select group_concat ('; ', 'the alter table', table_schema, '. ', table_name, add the column XXX ') from information_schema. The tables where table_schema='library' and table_name like 'table %';

CodePudding user response:

If you are familiar with the command line, you can use pipe
Mysql - e "spell to modify SQL query" -- the skip - column - names | mysql library name

CodePudding user response:


Junction post rate: 0%

When you the solutions of the problems please post.
http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html
http://topic.csdn.net/u/20100428/09/BC9E0908-F250-42A6-8765-B50A82FE186A.html
http://topic.csdn.net/u/20100626/09/f35a4763-4b59-49c3-8061-d48fdbc29561.html

8, how to give points and knot stick?
http://bbs.csdn.net/help#post_dispose

  • Related