我已经使用内连接连接了两个表。这里表的主键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'
如何使这个查询更简单?
请指导。