MySql 修改字段注释
作者:互联网
select CONCAT('alter table ',TABLE_NAME,' modify column ',' `',column_name,'` ',column_type,' ',IS_NULLABLE,' ',' comment ',"'",ccname,"'",' ;') from
(
SELECT
c.TABLE_NAME,c.column_name, c.column_type, case c.IS_NULLABLE when 'YES' then 'NULL' else 'NOT NULL' end IS_NULLABLE,c.COLUMN_DEFAULT,i.ccname,c.COLUMN_KEY,length(c.COLUMN_KEY)
FROM
intelligent_ai_test.cinfo i
LEFT JOIN information_schema.`COLUMNS` c ON c.TABLE_SCHEMA = 'big_data_spmh'
AND c.TABLE_NAME = i.tname
AND i.cname = c.COLUMN_NAME
) t;
标签:NAME,NULLABLE,column,COLUMN,注释,修改,MySql,TABLE,NULL 来源: https://www.cnblogs.com/aaron137/p/15812932.html