Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Fri, 13 Dec 2013 @ 17:07:55 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


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



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 24 Jul 2020