比较mysql上的两个表结构
此查询用于比较mysql上的两个表结构: select column_name ,max(case when table_name = 'table_1' then 'Yes' end) as in_table_1 ,max(case when table_name = 'table_2' then 'Yes' end) as in_table_2 from information_schema.columns where table_name in('table_1', 'table_2') and table_schema = 'your_database' group by column_name order by column_name; 选择列名称 ,max(表名称='table_1'然后是'Yes'结束时的情况),如表1中所示 ,max(表名称='table_2'然后是'Yes'结束时的情况),如表2中所示 从信息_schema.columns 其中,表_名称位于('table_1'、'table_2') 表_schema='your_database' 组 按列名称 秩序 按列名称; 但它会将列名转换为小大写,有人知道如何调整它以比较大小大写混合的列吗?根据: 列、索引、存储例程和 事件名称在上不区分大小写 任何平台,也不是列别名。”比较mysql上的两个表结构,mysql,Mysql,此查询用于比较mysql上的两个表结构: select column_name ,max(case when table_name = 'table_1' then 'Yes' end) as in_table_1 ,max(case when table_name = 'table_2' then 'Yes' end) as in_table_2 from information_schema.columns where table_name in('table_