1. 程式人生 > >MySQL 命令集合

MySQL 命令集合

not null bsp clas null change 命令 tables chang schema

功能1:批量修改Mysql 字段大小寫

SELECT CONCAT(ALTER table ,t2.table_schema,.,t2.table_name, CHANGE , \`,t2.column_name,\` \`,UPPER(t2.column_name),\` ,  
       t2.column_type, ,CASE WHEN t2.is_nullable=NO THEN not null ELSE null END, COMMENT ‘‘‘,t2.column_comment,‘‘‘;) AS c  
FROM information_schema.tables t1, information_schema.columns t2  
WHERE t1.table_schema = yourusername AND t1.table_type = base table AND t1.table_schema = t2.table_schema AND t1.table_name = t2.table_name

MySQL 命令集合