Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 01 Jul 2005 @ 20:54:48 GMT


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


Subj:   Re: SQL to flattening a table
 
From:   Christian Schiefer, makeITdone

Hi,

what about windowing OLAP functions:

     select cust_no
            , max( acc_no ) over ( partition by cust_no order by acc_no asc
                                   rows between 1 following and 1 following )
     as acc_one

            , max( acc_no ) over ( partition by cust_no order by acc_no asc
                                   rows between 1 following and 1 following )
     as acc_two

            , max( acc_no ) over ( partition by cust_no order by acc_no asc
                                   rows between 1 following and 1 following )
     as acc_three

from ...

Greetings

Christian



     
  <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