Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 02 Apr 2007 @ 21:08:41 GMT


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


Subj:   Re: Teradata Join condition with case statement
 
From:   Jinesh P V

You could try the following.

     sel * from
             (sel acc_col_1 as acc_cd, '2A' as acc_id
             from A_acc_sp
             union all
             sel acc_col_2 as acc_cd, '3A' as acc_id
             from A_acc_sp
             union all
             sel acc_col_3 as acc_cd, '4A' as acc_id
             from A_acc_sp
             union all
             sel acc_col_4 as acc_cd, '5A' as acc_id
             from A_acc_sp
             union all
             sel acc_col_5 as acc_cd, '6A' as acc_id
             from A_acc_sp
             union all
             sel acc_col_6 as acc_cd, '7A' as acc_id
             from A_acc_sp )A_acc_sp
     left join
             B_acc_tmp B_acc_tmp
     on      B_acc_tmp.acc_id = A_acc_sp.acc_id
     and     B_acc_tmp.acc_cd = A_acc_sp.acc_cd;

thanks,

Jinesh P V



     
  <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