Home > database >  How to classify multiple tables at the same time adding new id
How to classify multiple tables at the same time adding new id

Time:09-29

Multiple tables have been designed, write a program to read and write, now suddenly required to add a new category, and all tables should have this category id, what's the solution?

CodePudding user response:

Perform such statements, can generate a table for all increase category id of the SQL statement
Then you put on the generated SQL execution in a
 select concat (' the alter table, table_schema, '. ', table_name, 'add category id int. ') from information_schema. Tables where table_schema='test' 
  • Related