Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 10 Jul 2006 @ 12:39:49 GMT


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


Subj:   Re: Converting Rows to coulmns by some Fucnction of teradata
 
From:   Vinod Sugur

Hi,

     select a.id,a.tp_code,b.tp_code,c.tp_code,d.tp_code,e.tp_Code
     >From test_2 a JOIN test_2  b ON
     a.id = 124999720 AND a.tp_code = 'MBLOTM' AND
     a.id = b.id AND b.tp_code = 'MBLACF'
     JOIN test_2 c ON
     a.id = c.id AND c.tp_code = 'MBLPCP'
     JOIN test_2 d ON
     a.id = d.id AND d.tp_code = 'MBLSMS'
     JOIN test_2 e ON
     a.id = e.id AND e.tp_code = 'MBLDMF'

     OR

     select a.id,b.tp_code,c.tp_code,d.tp_code,e.tp_Code,f.tp_code
     >From (Select distinct id FROM TEST_2
     ) a
       LEFT JOIN test_2  b ON
     a.id = b.id AND b.tp_code = 'MBLOTM'
     LEFT JOIN test_2 c ON
     a.id = c.id AND c.tp_code = 'MBLACF'
     LEFT JOIN test_2 d ON
     a.id = d.id AND d.tp_code = 'MBLPCP'
     LEFT JOIN test_2 e ON
     a.id = e.id AND e.tp_code = 'MBLSMS'
     LEFT JOIN test_2 f ON
     a.id = f.id AND f.tp_code = 'MBLDMF'

I hope this helps.


Regards,

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