例:我想要删除contract这个库中所有表中列名为del_flag1的字段,则sql语句如下
SELECT
table_name,CONCAT('alter table ',TABLE_NAME,' drop del_flag1')
FROM
information_schema.`COLUMNS`
WHERE
TABLE_SCHEMA = 'contract' and column_name ='del_flag1';
得到结果后执行一下即可
例:我想要删除contract这个库中所有表中列名为del_flag1的字段,则sql语句如下
SELECT
table_name,CONCAT('alter table ',TABLE_NAME,' drop del_flag1')
FROM
information_schema.`COLUMNS`
WHERE
TABLE_SCHEMA = 'contract' and column_name ='del_flag1';
得到结果后执行一下即可