|
|
Archives of the TeradataForum
Message Posted: Fri, 13 Dec 2013 @ 17:07:55 GMT
Subj: | | Re: Conditional Update with CASE |
|
From: | | Dieter Noeth |
Anomy.Anom wrote:
| As you can see, this is just value that we are hardcoding based on source text value. In lieu of multiple update statements which are time
consuming, can we possibly write updates with CASE? | |
This is a perfect case for CASE:
update SUBSCR
set isourceid =
case
when source like '%||Newsletter %' then 60
when source like '%||CustomerService %'
or source like 'BrandSite %' then 65
end
where isourceid = 0
and (source like '%||Newsletter %' or
source like '%||CustomerService %' or
source like 'BrandSite %');
Dieter
| |