insert.. select
eg. insert into tb1 select * from tb2 ;create … like
eg. create tb1 like tb2;查看所有库中包含指定字段的所有表
1
2
3
4select * from information_schema where column_name='xxx';
-- 指定db
select * from information_schema where column_name='xxx' and table_schema='xxdb';批量修改表字段类型
1
2
3
4
5select CONCAT('alter table ',TABLE_SCHEMA,'.',TABLE_NAME,'
modify `', COLUMN_NAME, '` bigint(20) ',
' default ', COLUMN_DEFAULT, ' COMMENT '' , COLUMN_COMMENT, '';')
from information_schema.COLUMNS
where COLUMN_NAME = 'first_order_id';