Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 25 Jul 2005 @ 09:50:03 GMT


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


Subj:   Re: Rank and dense_rank
 
From:   Victor Sokovin

  The ANSI function name for "dense_rank" is ROW_NUMBER. That is available in Teradata from V2R5.0 forward.  


Do you have a reference for this statement?

Oracle, which is supposed to be ANSI compliant in this area, gives the following results in my simplest example.

     SELECT A, B,
     rank() OVER (ORDER BY A) AS RANK,
     dense_rank() OVER (ORDER BY A) AS DENSE_RANK,
     row_number() OVER (ORDER BY A) AS ROW_NUMBER
     FROM TEST1
     ORDER BY A, B

returns

     A   B   RANK   DENSE_RANK   ROW_NUMBER

     1   1   1      1            1
     1   1   1      1            2
     2   2   3      2            3
     3   3   4      3            4

My table contains the following data:

     A   B

     1   1
     1   1
     2   2
     3   3

As you see, DENSE_RANK and ROW_NUMBER are not at all equivalent here.


Regards,

Victor



     
  <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