Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 05 Dec 2003 @ 16:16:05 GMT


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


Subj:   Re: Help me in executing this
 
From:   Fred W Pluebell

Take your pick...

CASE Statement forms

               Case
                        When    num2=1 Then SET num3=a
                        When    num2=2 Then SET num3=b
                        When    num2=3 Then SET num3=c
                        ELSE     SET num3=0

                END case;

or

               Case num2
                        When   1 Then SET num3=a
                        When   2 Then SET num3=b
                        When   3 Then SET num3=c
                        ELSE     SET num3=0

                END case;

CASE Expression forms

                SET num3 = Case
                        When    num2=1 Then a
                        When    num2=2 Then b
                        When    num2=3 Then c
                        ELSE     0

                END ;

or

                SET num3 = Case num2
                        When    1 Then a
                        When    2 Then b
                        When    3 Then c
                        ELSE     0

                END ;


     
  <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: 15 Jun 2023