develog

oracle outer join or 본문

DB/Oracle

oracle outer join or

냐옴 2012. 12. 6. 23:54

(X)

SELECT *

FROM A, B

WHERE A.COL1 = B.COL1(+)

AND B.COL2(+) IN ('C','D')

;


(O)

SELECT *

FROM A, B

WHERE A.COL1 = B.COL1(+)

AND DECODE(B.COL2(+), 'C', 1, 'D', 1, 0) = 1

;


(O)

SELECT *

FROM A, B

WHERE A.COL1 = B.COL1(+)

AND (B.COL2 IS NULL OR B.COL2 IN ('C','D'))

;


'DB > Oracle' 카테고리의 다른 글

Pseudo Columns  (0) 2012.12.12
split  (0) 2012.12.11
outer join test  (0) 2012.07.25
DROP, DELETE, TRUNCATE 차이점  (0) 2012.04.10
Comment  (0) 2012.04.10
Comments