SELECT name FROM users
WHERE id=(SELECT added_id FROM relations
WHERE status='1' AND adding_id=2);
有这个,但我需要搜索与此搜索匹配的所有名称。
答案 0 :(得分:0)
你做错了是使用=
而不是in
条款。
SELECT name FROM users
WHERE id in (SELECT added_id FROM relations
WHERE status='1' AND adding_id=2);