Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 06 Oct 2002 @ 22:25:32 GMT


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


Subj:   Re: Numbering records (simple question)
 
From:   McCall, Glenn D

Both Rank and CSUM can generate sequential numbers. The is a potential problem with rank in that it may generate duplicate numbers. CSUM does not.

In the event that two or more records have the same values in the sort key RANK will assign the same rank to those records.

For example

Select a, b, csum (1, a), rank (1, b asc) from t order by a;

Will give the following:

a       b       CSum    Rank
1       1       1       1
2       2       2       2
3       2       3       2
4       3       4       4

Regards

Glenn Mc



     
  <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