内部結合を使用して2つのテーブルを結合しました。ここで、テーブルの主キーTPREG
はco_id
pol_id
SELECT (SELECT etbl_desc_txt
FROM uding604.tedit e
WHERE etbl_typ_id = 'PITCD'
AND co_id = 'CP'
AND etbl_valu_id = p.pol_ind_typ_cd) pol_ind_typ_cd,
(SELECT etbl_desc_txt
FROM uding604.tedit e
WHERE etbl_typ_id = 'PAYT'
AND co_id = 'CP'
AND etbl_valu_id = p.POL_BILL_TYP_CD) POL_BILL_TYP_CD,
POL_PAC_DRW_DY,
(SELECT etbl_desc_txt
FROM uding604.tedit e
WHERE etbl_typ_id = 'PAYM'
AND co_id = 'CP'
AND etbl_valu_id = p.POL_BILL_MODE_CD) POL_BILL_MODE_CD,
t.SOURCE_CD
FROM uding604.tpol p,
uding604.TPREG t
WHERE p.co_id = t.co_id
AND p.pol_id = t.pol_id
AND p.co_id = 'CP'
AND p.pol_id = '000000011'
AND t.co_id = 'CP'
AND t.pol_id = '000000011'
このクエリをより簡単にする方法は?
ご案内ください。