Archives of the TeradataForum
Message Posted: Fri, 13 Dec 2013 @ 17:41:51 GMT
Subj: | | Re: Conditional Update with CASE |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Friday, December 13, 2013 12:34 -->
You can use a CASE expression to determine the updated value:
Set isourceid = CASE WHEN .... THEN 60 WHEN .... THEN 65 ... END
Note that you also need to include the WHEN conditions in the WHERE clause, to avoid updating all rows.
Or less efficiently, the CASE could have an "ELSE isourceid" to leave the value unchanged (even though the row is updated).
|