WITH TEMP AS(
SELECT '1' CD FROM DUAL
UNION ALL
SELECT '2' CD FROM DUAL
UNION ALL
SELECT '3' CD FROM DUAL
UNION ALL
SELECT '4' CD FROM DUAL
UNION ALL
SELECT '5' CD FROM DUAL
UNION ALL
SELECT '6' CD FROM DUAL
UNION ALL
SELECT '7' CD FROM DUAL
UNION ALL
SELECT '8' CD FROM DUAL
UNION ALL
SELECT '9' CD FROM DUAL
UNION ALL
SELECT '10' CD FROM DUAL
UNION ALL
SELECT '11' CD FROM DUAL
)
SELECT (CASE WHEN INSTR('1,2,3,4,5,6,7,8,9,10,11',CD) > 0 THEN 'Y' ELSE 'N' END) CHECK_SELECT
FROM TEMP
이쿼리에서 '1,2,3,4,5,6,7,8,9,10,11'-->이값이 '2,3,4,5,6,7,8,9,10,11' 이렇게될때요..
1인값은 N으로되야하는데..11때문에 Y가 되거든요..ㅠㅠ
고수님들 어떻게해야 나오게 할수있을까요~
알려주시면 감사드리겠습니다~^^
|