oracle合并语句中的多个case语句

时间:2016-04-06 19:41:50

标签: c# .net oracle merge

我发布了我的工作合并声明的一部分,如下所示,我为MERGE INTO table2 a USING table1 b ON (a.second_name = b.first_name) WHEN MATCHED THEN UPDATE SET a.friendly_name = TRIM(b.friendly_name), a.account_number = TRIM(b.account_no), a.ne_type = TRIM(b.ci_type), a.service_type_id = CASE WHEN upper(trim(b.company_name)) LIKE '%MWAN%' OR upper(trim(b.company_name)) LIKE '%MGWAN%' OR upper(trim(b.company_name)) LIKE '%MWLAN%' OR upper(trim(b.company_name)) LIKE '%MLAN%' OR upper(trim(b.company_name)) LIKE '%DDOS%' OR trim(b.first_name) LIKE 'mss%' THEN 10 ELSE 20 END, 其他20设置了10

DDOS

我的新要求是,如果出现 MERGE INTO table2 a USING table1 b ON (a.second_name = b.first_name) WHEN MATCHED THEN UPDATE SET a.friendly_name = TRIM(b.friendly_name), a.account_number = TRIM(b.account_no), a.ne_type = TRIM(b.ci_type), a.service_type_id = CASE WHEN upper(trim(b.company_name)) LIKE '%MWAN%' OR upper(trim(b.company_name)) LIKE '%MGWAN%' OR upper(trim(b.company_name)) LIKE '%MWLAN%' OR upper(trim(b.company_name)) LIKE '%MLAN%' OR trim(b.first_name) LIKE 'mss%' THEN 10 WHEN upper(trim(b.company_name)) LIKE '%DDOS%' THEN 30 ELSE 20 END. 将其设置为30,那么以下更改就足够了

CASE

我现在没有oracle sql开发人员,我稍后会测试,但我的猜测工作是正确的?还是任何语法错误Reader 1 -> Partition 0 & 1 Reader 2 -> Partition 2 & 3 阻止

0 个答案:

没有答案