我试图找出这两个语句有效或无效的情况。我能够在一个项目中使用声明 1 几次;但是我无法解读其中的区别。声明 1
UPDATE tbl1 AS a INNER JOIN tbl2 as b where a.clm = b.clm
SET
a.clm1 =
CASE
WHEN b.clm2 = 1 THEN 11
ELSE 2
END,
b.clm2 =
CASE
WHEN b.clm4 = 2 THEN 3
ELSE 100
END;
相比
声明 2
UPDATE a
SET
a.clm1 =
CASE
WHEN b.clm2 = 1 THEN 11
ELSE 2
END,
b.clm2 =
CASE
WHEN b.clm4 = 2 THEN 3
ELSE 100
END
FROM tbl1 AS a INNER JOIN tbl2 as b where a.clm = b.clm;