1 2 3 4 5 6 7 8 9 10 11 12 13 14 | WITH TEST AS ( SELECT 'AA' CODE, '0001' VALUE01 , '0002' VALUE02 , '0003' VALUE03 , '0004' VALUE04 , '0005' VALUE05 , '0006' VALUE06 , '0007' VALUE07 , '0008' VALUE08 , '0009' VALUE09 FROM DUAL UNION ALL SELECT 'BB' CODE, '1101' VALUE01 , '1102' VALUE02 , '1103' VALUE03 , '1104' VALUE04 , '1105' VALUE05 , '1106' VALUE06 , '1107' VALUE07 , '1108' VALUE08 , '1109' VALUE09 FROM DUAL ) SELECT CODE FROM TEST WHERE VALUE01 = '0001' OR VALUE02 = '0001' OR VALUE03 = '0001' OR VALUE04 = '0001' OR VALUE05 = '0001' OR VALUE06 = '0001' OR VALUE07 = '0001' OR VALUE08 = '0001' OR VALUE09 = '0001' ; |
1 2 3 | SELECT * FROM ( SELECT '1' a1 , '2' a2 , '3' a3 FROM DUAL ) WHERE '1' in (a1 , a2 , a3 ) |