Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 27 Oct 2010 @ 08:49:12 GMT


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


Subj:   Re: Pivot temp table
 
From:   Stieger, Etienne

Hi Faible,

Try something like:

     Select T_1.col, T_1.attr1, T_1.attr2, T_1.attrN,
     ROW_NUMBER() OVER (PARTITION BY T_1.col, T_1.attr1, T_1.attr2, T_1.attrN ORDER BY T_1.col
     asc, T_1.attr1 asc, T_1.attr2 asc, T_1.attrN asc) SurKey From ( Select col1 as col,
     attr1, attr2, attrN from tsrc1 Union all Select col2 as col, attr1, attr2, attrN from
     tsrc1 Union all Select col1 as col, attr1, attr2, attrN from tsrc2 Union all Select col2
     as col, attr1, attr2, attrN from tsrc2 Etc...
     Etc...
     ) T_1

Regards

Etienne Stieger

Etienne Stieger
DW DBA, Technical Specialist
Analytics and Information Management (AIM/EIW)
Standard Bank



     
  <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