Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Wed, 19 Mar 2008 @ 22:13:13 GMT

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

Subj:   Re: Comparing blanks and Nulls
From:   Anomy Anom

<-- Anonymously Posted: Wed, 19 Mar 2008 17:12 -->

I appreciate the help - I think I'm all set.

Without going into great context, the process that got us to this point is the reason for the difference, not the source data.

The three fields I initially looked at are CHAR(1).

We have a function called ASCII that returned value 0, but CHARACTERS function returned value 1.

Using the NullIf allowed me to equate them.

     coalesce (Nullif(colA, ''), '*')
     from TableX
     coalesce(colA , '*')
     from TableY

one thing I found surprising: all three below returned a *.

     ,COALESCE(Nullif(colA, ''),  '*' ) AS colA
     ,COALESCE(Nullif(colA, ' '),  '*' ) AS colA
     ,COALESCE(Nullif(colA, '    '),  '*' ) as colA

  <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: 28 Jun 2020