那么DB2中的多个语句

时间:2017-10-30 15:28:43

标签: sql db2 dashdb

我希望我的THEN声明能够做类似

的事情
MERGE INTO ...
USING (...)
WHEN true
THEN [Update 1] AND [Update 2]

实现此目的的正确语法是什么?

我道歉,我应该更清楚。

感谢您的时间!

2 个答案:

答案 0 :(得分:1)

You could use:

CASE 
 WHEN condition
    statement1;
    statement2;
 ELSE    
    else_statement;
END CASE;

Please note the difference between case expression/statement.

答案 1 :(得分:0)

Two case expressions:

(Case When true Then [Statement 1] end),
(case when true then [Statment 2] end)

As with all expressions, a case expression only returns one value.