如何合併以下兩個查詢,以便我可以獲得兩列PAYMODE 和PAYTYPE。兩個查詢都是相似的,並且是相同的表。將兩個sql查詢組合成一個查詢,以便我不需要執行兩個單獨的查詢。將兩個sql查詢合併爲一個查詢
SELECT ETBL_DESC_TXT as PAYMODE
FROM tedit
WHERE CO_ID = 'CP'
AND ETBL_TYP_ID = 'PMODE'
AND ETBL_VALU_ID = 'RC'
select ETBL_DESC_TXT as PAYTYPE
FROM tedit
WHERE CO_ID = 'CP'
AND ETBL_TYP_ID = 'PTYPE'
AND ETBL_VALU_ID = 'ER'
製作UNION –
使用'或':'AND((X = 'PMODE' 和y = 'RC')或(x = 'PTYPE' 和y = 'ER'))' –