All Forums Database
KVB 124 posts Joined 09/12
07 Oct 2013
Anything similar to DENSE_RANK() in Oracle

Hi
I am using TD 13.I have a scenario where I need to represent dates to a sequence.And I have multiple id's for the same date.Each date i would like to represnt a single number only.
It canbe done using DENSE_RANK() INoracle or TD14.But How cani achieve it in TD 13.
Example data:
empno doj   rank
1          current_date  1
2         current_date    1
3          current_date    1
4          current_date+1   2
5         current_date+1     2
Regards
KVB
 
 
 
 
 
 

Glass 225 posts Joined 04/10
07 Oct 2013

KVB,
you can install the dense_rank UDF on your system.
 
Robert
 

Raja_KT 1246 posts Joined 07/09
07 Oct 2013

Hi,
Teradata has rank function. All you need to do is tweak with a self  join and rank.
I think Dieter has worked it out. Re-inventing the wheel????
 
http://developer.teradata.com/blog/dnoeth/2011/05/missing-functions-dense-rank
 
Thanks and regards,
Raja

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

You must sign in to leave a comment.