gpt4 book ai didi

MySQL数据库查询返回空结果

转载 作者:行者123 更新时间:2023-11-29 03:41:36 25 4
gpt4 key购买 nike

我正在进行数据迁移,并通过一个连接获得简单查询的空结果。以下是查询

Select * from users u INNER JOIN temp_users tu ON tu.uid = u.uid

两个表中有数百条记录具有相同的uid,但此查询仅返回一条记录。

表格结构如下

users table
uid: varchar(50) utf8_general_ci Yes NULL

temp_users table
uid: varchar(50) utf8_general_ci Yes NULL

最佳答案

试试这个..

Select * from users u INNER JOIN temp_users tu ON trim(upper(tu.uid)) = trim(upper(u.uid));

可能没有匹配的 id b/w 表..确认使用..

Select u.id,tu.id from users u LEFT JOIN temp_users tu ON trim(upper(tu.uid)) = trim(upper(u.uid));

关于MySQL数据库查询返回空结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13175550/

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