数据库技术 / 正文

批量生成多个表 修改字段类型的语句

2024-01-13 23:29 2189 浏览
评论(0
字体大小:

 

select concat('alter table ', table_name, ' modify ', column_name, ' bigint') from information_schema.columns where table_schema = 'shop_ceshi' and column_name = 'product_id';

执行结果:

alter table shop_product modify product_id bigint ;
alter table shop_product_attr_index modify product_id bigint;
#......
alter table shop_product_browse modify product_id bigint;

然后复制执行结果, 执行, 成功

本文发布于程序达人 ,转载请注明出处,谢谢合作

0 人认为有用
0 评论

相关热点文章推荐

程序达人 - chengxudaren.com

一个帮助开发者成长的社区

相关文章