SELECT DISTINCT sci.le_id AS le_id,
sci.sub_profile_id AS sub_profile_id,
sci.GROUP_ID AS GROUP_ID,
sci.cdd_id,
sci.crm_id,
sci.grp_crm_id,
sci.source,
sci.category
FROM table_name sci
WHERE sci.crm_id IN (SELECT master.x_ref_id
FROM biz_master master, biz_pr_master pr
WHERE master.x_latest_txn_id = pr.x_txn_id
AND pr.x_leid IS NULL
AND pr.GROUP_ID IS NULL)发布于 2020-06-25 15:41:33
然后将其添加到WHERE子句中,如下所示:
WHERE ......
AND (sci.source <> 'CC' -- this condition will be true for all other sci.source
OR sci.category <> 'not awaiting') -- This condition will be checked if sci.source = CC 发布于 2020-06-25 15:43:44
我在想像CASE这样的东西
and sci.category <> case when sci.source = 'CC' then 'not awaiting'
else '???
endhttps://stackoverflow.com/questions/62570204
复制相似问题