Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 19 Mar 2008 @ 20:22:33 GMT


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


Subj:   Re: Comparing blanks and Nulls
 
From:   Michael Larkins

Sounds like you have some pretty inconsistent source data that might better be scrubbed before you load it into a production table. Additionally, you have not specifically told us, but to have a zero length I am assuming that the string must be varchar. Also as pointed out previously, a zero length character string is not the same as a NULL. So have you considered:

     ,case when char(blank_column) = 0 then '*' else blank_column) end
     .
     .
     .
     MINUS ALL

     ,coalesce(nullable_column,'*')
     .
     .
     .

If need be, you can also check for the NULL in the same case statement. If you have similiar inconsistencies in the second table you can impliment the coalesce using a case and compare for multiple values there as well.


Hope this helps,

Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor



     
  <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