Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
比较mysql上的两个表结构_Mysql - Fatal编程技术网

比较mysql上的两个表结构

比较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_

此查询用于比较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' 组 按列名称 秩序 按列名称; 但它会将列名转换为小大写,有人知道如何调整它以比较大小大写混合的列吗?

根据:

列、索引、存储例程和 事件名称在上不区分大小写 任何平台,也不是列别名。”