MySQL 命令集合

时间:2018-11-20 13:06:24   收藏:0   阅读:165

功能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  

 

原文:https://www.cnblogs.com/hl137510705/p/9987997.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!