gpt4 book ai didi

mysql - 比较mysql上的2个表结构

转载 作者:行者123 更新时间:2023-11-29 07:08:38 25 4
gpt4 key购买 nike

此查询的作用是比较 mysql 上的 2 个表结构:

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;

但是它将列名称转换为小型大写字母,有人知道如何调整它以比较混合小型和大写字母的列吗?

最佳答案

根据 MySQL manual :

"Column, index, stored routine, and event names are not case sensitive on any platform, nor are column aliases."

关于mysql - 比较mysql上的2个表结构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5871717/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com