Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 16 Sep 2005 @ 14:13:21 GMT


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


Subj:   Re: Compare rows of tableA to rows of tableB - HOW?
 
From:   Vinod Sugur

Hi,

Just checkout the below query if you want handle NULL in different way you can use the below query:

     select C1,c2,c3
     from tableA A
     Where not exists
     (Select 1
     >From TableB B
     Where (Coalesce(a.c1,b.c1) IS  NULL OR a.c1 = b.c1)
         AND
         (Coalesce(a.c2,b.c2) IS   NULL OR a.c2 = b.c2)
         AND
         (Coalesce(a.c3,b.c3) IS  NULL OR a.c3 = b.c3)
);

The query given by Sonje is good.

Vinod



     
  <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