Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 03 Oct 2008 @ 10:26:36 GMT


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


Subj:   Ranking function
 
From:   Pararha, Shubhangi

Hi,

Can anyone please tell me what this query is doing:

     ,RANK () OVER (PARTITION BY A.CODE,
                                 A.DATE,
                                 A.TRK_CD,
                                 A.CELL_CD,
                                 A.VALUE_CD,
                                 A.TREATY__CD,
                                 A.NUM_R,
                                 A.CNTRY,
                                 A.IND,
                                 A.CYCLE

      ORDER BY B.ACQS_DATE,B.NUM_R2)

My understanding was:

For the same

                                 A.CODE,
                                 A.DATE,
                                 A.TRK_CD,
                                 A.CELL_CD,
                                 A.VALUE_CD,
                                 A.TREATY__CD,
                                 A.NUM_R,
                                 A.CNTRY,
                                 A.IND,
                                 A.CYCLE

The ranking will be on B.ACQS_DATE,B.NUM_R2. When any of the above changes - the ranking will start again for B.ACQS_DATE,B.NUM_R2.

But I see ranks being skipped ..like after rank =1, rank= 13...


Regards,

Shubhangi



     
  <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