将下面sql的结果拷贝到内存中再执行. 行里的字段显示不全,可点击右上角齿轮图标,设置一个字段字数为1000
select
CONCAT('ALTER TABLE `',TABLE_NAME,'` MODIFY COLUMN `',COLUMN_NAME,'` ',COLUMN_TYPE
,case when CHARACTER_SET_NAME is not null then CONCAT(' CHARACTER SET ',CHARACTER_SET_NAME,' COLLATE ',COLLATION_NAME) else '' end
,' NULL;') as alterSQL
from information_schema.`COLUMNS`
where TABLE_SCHEMA = 'mayidaohang' and TABLE_NAME like 'dueros_cmd_%'
and IS_NULLABLE = 'NO' and COLUMN_KEY not in ('PRI') and EXTRA not in ('auto_increment')
and COLUMN_DEFAULT is null
分类:电脑技术
标签:
评论已关闭!