Neoview SQL Reference Manual (R2.4)

Return the rank of I1:
SELECT I1, RUNNINGRANK (I1) AS RANK
FROM cat.sch.seqfcn
SEQUENCE BY I1;
I1 RANK
----------- --------------------
1 1
2 2
3 3
4 4
5 5
6 6
8 7
10 8
--- 8 row(s) selected.
Return the rank of I1 descending:
SELECT I1, RUNNINGRANK (I1) AS RANK
FROM cat.sch.seqfcn
SEQUENCE BY I1 DESC;
I1 RANK
----------- --------------------
10 1
8 2
6 3
5 4
4 5
3 6
2 7
1 8
--- 8 row(s) selected.
Return the rank of I2, using the alternative RANK syntax:
SELECT I2, RANK (I2) AS RANK
FROM cat.sch.seqfcn
SEQUENCE BY I2;
I2 RANK
----------- --------------------
100 1
100 1
200 3
200 3
200 3
300 6
? 7
? 7
--- 8 row(s) selected.
Notice that the two NULL values received the same rank.
Return the rank of I2 descending, using the alternative RANK syntax:
SELECT I2, RANK (I2) AS RANK
FROM cat.sch.seqfcn
SEQUENCE BY I2 DESC;
428 SQL Functions and Expressions