SELECT
description_arab,
CTS_TRX_TYPE,
comp_code,
branch_code,
currency_code,
gl_code,
cif_sub_no,
cts_trs_no,
trans_date,
value_date,
fc_amount,
cv_amount,description,case when fc_amount is null then '0' else fc_amount end end as fc ,
case when CTS_TRX_TYPE is null then 'JV' else CTS_TRX_TYPE end end as TRX_TYPE,
CASE WHEN CURRENCY_CODE = 368 THEN 'IQD' ELSE CASE WHEN CURRENCY_CODE = 840 THEN 'USD' END END AS CURRENCY
FROM dof WHERE to_date(trans_date,'DD/MM/YYYY') between to_date('24/09/18,'DD/MM/YYYY') AND
TO_DATE('21/11/18' ,'DD/MM/YYYY') and currency_code IS NOT NULL
order by cts_trs_no
1条答案
按热度按时间jv4diomz1#
是的,您可以对表中的多个列使用多个case语句。但从您的查询中,我可以看到额外的end语句,因此刚刚将它们从您的查询中删除,并更新了last case语句。不确定这是你想要的-