1.
SELECT DECODE(A.CNT+B.CNT,0,'Y','N') DEL_YN
FROM (
SELECT COUNT(*) CNT
FROM DBD007M
WHERE TXPR_BMEN_NO = '4028154166'
AND PART_NO = '1'
) A ,
(
SELECT COUNT(*) CNT
FROM DBD008M
WHERE TXPR_BMEN_NO = '4028154166'
AND PART_NO = '1'
) B
2.
SELECT DECODE(COUNT(*),0,'Y','N') DEL_YN
FROM (
SELECT TXPR_BMEN_NO , PART_NO
FROM DBD007M
UNION
SELECT TXPR_BMEN_NO , PART_NO
FROM DBD008M
)
WHERE TXPR_BMEN_NO = '4028154166'
AND PART_NO = '1'
-------------------------------------------------------
DATA가 많을 경우는 어떤 경우가 더 속도면에서 좋을까요?
TXPR_BMEN_NO , PART_NO 2개의 컬럼은 전부 INDEX를 탑니다