WITH TMP AS ( SELECT 'A창고' "창고", '비품1' "비품" FROM DUAL UNION ALL SELECT 'A창고' "창고", '비품2' "비품" FROM DUAL UNION ALL SELECT 'A창고' "창고", '비품3' "비품" FROM DUAL UNION ALL SELECT 'B창고' "창고", '비품1' "비품" FROM DUAL UNION ALL SELECT 'B창고' "창고", '비품2' "비품" FROM DUAL UNION ALL SELECT 'C창고' "창고", '비품2' "비품" FROM DUAL UNION ALL SELECT 'C창고' "창고", '비품3' "비품" FROM DUAL UNION ALL SELECT 'C창고' "창고", '비품4' "비품" FROM DUAL UNION ALL SELECT 'C창고' "창고", '비품5' "비품" FROM DUAL ) SELECT 창고 FROM TMP WHERE 비품 IN ('비품1', '비품3') GROUP BY 창고 HAVING COUNT(DISTINCT 비품) = 2;