DB2中coalesce函数的应用
时间:2021-07-01 10:21:17
帮助过:88人阅读
CI.RESOURCE_ID,
COALESCE(HR.MGR_ENTITYCODE, PS.BRAND_CD, PS.ORG) CAL_BRAND_CD,CI.BRAND_CD
FROM
TESTENV.CR__ITEMS AS CRI
LEFT OUTER JOIN TESTENV.PR_ITEMS
AS PRI
ON CI.PO_KEY
= PRI.PO_KEY
LEFT OUTER JOIN TESTENV.PURCHASE_SUMMARY
AS PS
ON PRI.PO_KEY
= PS.PO_KEY
AND PRI.PO_ITEM_NUM
= PS.PO_M_NUM
LEFT OUTER JOIN TESTENV.HR_CLD_CONT
AS HR
ON CI.RESOURCE_ID
= HR.RESOURCE_ID
WITH UR;
DB2中coalesce函数的应用
标签:不同的 entity 返回值 when 来源 问题 空值 语句 目标