WITH T AS (
SELECT 1 SEQ, '1' CLSS, '한글' CLSS_HG, '가' VAL FROM DUAL UNION ALL
SELECT 2 SEQ, '1' CLSS, '한글' CLSS_HG, '나' VAL FROM DUAL UNION ALL
SELECT 3 SEQ, '2' CLSS, '영어' CLSS_HG, 'A' VAL FROM DUAL UNION ALL
SELECT 4 SEQ, '2' CLSS, '영어' CLSS_HG, 'B' VAL FROM DUAL UNION ALL
SELECT 5 SEQ, '3' CLSS, '숫자' CLSS_HG, '1' VAL FROM DUAL UNION ALL
SELECT 6 SEQ, '3' CLSS, '숫자' CLSS_HG, '2' VAL FROM DUAL UNION ALL
SELECT 7 SEQ, '4' CLSS, '특수' CLSS_HG, '@' VAL FROM DUAL
)
1.
SELECT SEQ, CLSS, CLSS_HG, VAL FROM T
WHERE ((0=:p AND CLSS = CLSS) OR (CLSS=:p AND CLSS =1) OR (CLSS=:p AND CLSS=2) OR (CLSS=:p AND CLSS=3))
2.
SELECT SEQ, CLSS, CLSS_HG, VAL FROM T
WHERE ((0=:p AND CLSS = CLSS) OR (1=:p AND CLSS =1) OR (2=:p AND CLSS=2) OR (3=:p AND CLSS=3))
조회 조건이 0일떄 전체 1일때 한글, 2일때 영어, 3일때 특수가 검색되게 조건을 줄때요
1번과 2번 방법의 차이가있나요? 검색 속도나 머 여러가지요.....
|