我现在不太了解 SQL 查询,我有一个问题
SELECT PERSON_REF
FROM IMAGES
WHERE PERSON_REF IN (SELECT _PERSON_ID
FROM PERSONS
WHERE REGION_REF = (SELECT _REGION_ID
FROM REGIONS
WHERE REGION_ABB = "EU"))
GROUP BY PERSON_REF
HAVING Count(PERSON_REF) >= 3
这个查询给出了我的结果
2
4
5
6
现在我想在其他查询中使用该结果,如何做到这一点,我需要创建循环还是有其他方法
SELECT PERSON_REF
FROM IMAGES
WHERE EFFECT_REF = 2
AND PERSON_REF IN ( 2, 4, 5, 6 )