Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 06 Mar 2007 @ 09:16:11 GMT


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


Subj:   Re: Performance of a self join
 
From:   Goutham P

Thanks all for your reply.

Given below is my query:

     select        A.*
             ,Value2 / sum(Value2) over (partition by A.dim1, A.dim2, A.dim3,
     A.dim4) as value3
     from         A,
     (
              select        dim1
                     ,dim2
                     ,dim3
                     ,dim4
                     ,dim5
                     ,metric 1/count(metric 2) as value2
             from        A
             group by 1,2,3,4,5
     ) B
     where        A.dim1 = B.dim1
     and        A.dim2 = B.dim2
     and        A.dim3 = B.dim3
     and        A.dim4 = B.dim4
     and        A.dim5 = B.dim5
     and        A.dim6 = B.dim6

The PI of the table is only dim 1, dim2



     
  <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