统一将数据库中的数据类型转换为另外一种

如:查询出哪些表中用到了date数据类型

select CONCAT('alter table ', TABLE_SCHEMA, '.',table_name, ' MODIFY ',column_name, ' datetime;') as sqq, TABLE_SCHEMA, data_type 

from information_schema.columns
where TABLE_SCHEMA not in('__recycle_bin__', 'information_schema', 'mysql', 'sys') and data_type='date';

posted @ 2020-09-15 17:19  CEO雷总  阅读(321)  评论(0编辑  收藏  举报