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;