Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 19 Mar 2008 @ 23:13:24 GMT


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


Subj:   Re: Comparing blanks and Nulls
 
From:   ulrich arndt

Hi anomy,

would

     select case when a is null then ''  -- NULL to empty sting
                 when trim(both from a) = ''
                      then '' -- blank(s) to empty string
                      else a end
     from a
     minus
     select case when a is null then ''
                 when trim(both from a) = ''
                      then ''
                      else a end
     from b

do the trick?

In case empty string should be handeld different from blank then

     case when a is null then ' ' -- Null to one blank
          when trim(both from a) = '' and characters(a) >= 1
               then ' '
               else a end

Ulrich



     
  <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: 23 Jun 2019