使用 case 语句执行此选择时收到上述错误。我尝试了几种方法,但无法使语法正确。
SELECT m.md_security_id,
thv.unit_qty,
thv.contract_value_amt,
thv.contract_currency_cd,
(case when
THV.BORROW_LOAN_TYPE_CD = 'B'
then select THV.SENDER_ORG_ID as BORROWER_ORG_ID,
select THV.RECIPIENT_ORG_ID as LENDER_ORG_ID
end),
(case when
THV.BORROW_LOAN_TYPE_CD = 'L'
THEN select THV.RECIPIENT_ORG_ID as BORROWER_ORG_ID,
select THV.SENDER_ORG_ID as LENDER_ORG_ID
end)
FROM eqmddev.txn_header_mv thv,
eqmddev.md_security m,
eqmddev.security_xref_vw_tbl x
WHERE m.isin = x.security_id
AND ThV.SECURITY_MASTER_ID = X.SECURITY_MASTER_ID
AND M.EXCHANGE_CD = X.EXCHANGE_CD