我需要检索与 6 或 7 号玩家居住在同一街道和城镇的所有玩家的玩家编号、姓名、街道和城镇;
我不确定如何编写 SQL 查询,我想我需要在 WHERE 子句中有一个子查询,但不知道该怎么做。
这是我想出的,但目前我无法测试它
SELECT playerNo, name, street, town
FROM Players
WHERE street IN ( SELECT street, playerNo
FROM Players
WHERE playerNo IN (6,7));
AND town IN (SELECT town, playerNo
FROM Players
WHERE playerNo IN (6,7));
应该兼容Oracle 10g
感谢所有回复的人!