Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 03 Aug 2004 @ 13:14:35 GMT


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


Subj:   Re: Merging Result of two differnet query!
 
From:   Subramanian, Suresh

Hi

create two volatile table or temp tables where you can load the value of first query and the second query.

then try using this SQL..This query might not be the perfect one as far performance is concerned but still it will work ..

I am also interested in knowing other ways of doing the same..

     create volatile table t1 (
     date1 date
     ,col1   integer
     ,col2 integer)
     on commit preserve rows;
     create volatile table t2 (
     date2 date
     ,col3   integer
     ,col4 integer)
     on commit preserve rows


     sel
     coalesce (dt.dat,dt1.dat)
     ,dt.c1
     ,dt.c2
     ,dt1.c3
     ,dt1.c4
     from (

                 sel
                 date1
                 ,col1
                 ,col2
             from t1 ) dt ( dat,c1,c2)
     Full outer join
     (
             sel
             date2
             ,col3
             ,col4
             from t2
     ) dt1 ( dat,c3,c4)
     on dt.dat = dt1.dat
     ;

Cheers

Suresh



     
  <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