当前位置:   article > 正文

alter 修改表结构_alert 表结构

alert 表结构

– 批量删除一个表中字段
– select concat(‘alter table’,’ ‘,table_name,’ ',‘drop brand;’) from information_schema.tables where table_schema=‘co’;
注: brand为字段名,co为数据库名,concat聚合函数

– 批量新增一个表中字段
select concat(‘alter table’,’ ‘,table_name,’ ‘,add 字段名 类型 default默认值) from information_schema.tables where table_schema=‘co’;
类似于:
select concat(‘alter table’ ,table_name ,’ add brand varchar(255) default ‘co’;’) from information_schema.tables where table_schema='co;

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/525609
推荐阅读
相关标签
  

闽ICP备14008679号