Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我的要求
我根据两个表(ab)之间的电子邮件匹配选择用户 ID。然后我将根据另一个表(c)中的用户 ID 选择信息。
SELECT a.email, b.id FROM `user_fnf_info` AS a JOIN users AS b ON a.email = b.email WHERE a.user_id =1;
可以在 mysql 中进行两个查询,但我需要知道如何在单个查询(mysql)中编写。
任何人都可以帮助我解决这个要求。在此先感谢。
JOIN他们与第三张桌子:
JOIN
SELECT a.email, b.id FROM `user_fnf_info` AS a INNER JOIN users AS b ON a.email = b.email INNER JOIN thethirdtable AS c ON a.user_id = c.user_id WHERE a.user_id =1;