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

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

Glass 225 posts Joined 04/10
07 Oct 2013

you can install the dense_rank UDF on your system.

Raja_KT 1246 posts Joined 07/09
07 Oct 2013

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????
Thanks and regards,

Raja K Thaw
My wiki:
Street Children suffer not by their fault. We can help them if we want.

You must sign in to leave a comment.