원하시는답변일지는 모르겠지만.. --과목이있는경우 'Y', 과목이없는경우 'N' WITH SEARCH_STUNO AS ( SELECT '1' STUDENTNO, 'Y' ENGLISH, 'Y' MATH , 'Y' SCIENCE FROM DUAL UNION ALL SELECT '2' STUDENTNO, 'Y' ENGLISH, 'N' MATH , 'Y' SCIENCE FROM DUAL UNION ALL SELECT '3' STUDENTNO, 'N' ENGLISH, 'Y' MATH , 'Y' SCIENCE FROM DUAL UNION ALL SELECT '4' STUDENTNO, 'Y' ENGLISH, 'Y' MATH , 'N' SCIENCE FROM DUAL ) SELECT STUDENTNO FROM SEARCH_STUNO WHERE ( ENGLISH = 'Y' AND MATH = 'Y' )