Row_Number() - Assigns sequential numbers to the records of a result-set or to the records within groups of a result-set
Rank() - Returns the rank of each row within the partition of a result set.
Dense_Rank() - Returns the rank of rows within the partition of a result set, without any gaps in the ranking
NTILE(n) - Splits the records into partition based on the Column in the Over() and assigns the Rank for the partition.
SQL> Select
2 EMPNO,ENAME,JOB,SAL,DEPTNO
3 ,Row_Number() Over(Order By JOB) "RowNo"
4 ,Rank() Over(Order By JOB) "Rank"
5 ,Dense_Rank() Over(Order By JOB) "Dense Rank"
6 ,NTile(4) Over(Order By JOB) "NTile"
7 From Emp;
EMPNO ENAME JOB SAL DEPTNO RowNo Rank Dense Rank NTile
---------- ---------- --------- ---------- ---------- ---------- ---------- ---------- ----------
7788 SCOTT ANALYST 3000 20 1 1 1 1
7902 FORD ANALYST 3000 20 2 1 1 1
7934 MILLER CLERK 1300 10 3 3 2 1
7900 JAMES CLERK 950 30 4 3 2 1
7369 SMITH CLERK 800 20 5 3 2 2
7876 ADAMS CLERK 1100 20 6 3 2 2
7698 BLAKE MANAGER 2850 30 7 7 3 2
7566 JONES MANAGER 2975 20 8 7 3 2
7782 CLARK MANAGER 2450 10 9 7 3 3
7839 KING PRESIDENT 5000 10 10 10 4 3
7844 TURNER SALESMAN 1500 30 11 11 5 3
7654 MARTIN SALESMAN 1250 30 12 11 5 4
7521 WARD SALESMAN 1250 30 13 11 5 4
7499 ALLEN SALESMAN 1600 30 14 11 5 4
14 rows selected.
We have all these ranking function from Sql Server 2005
Hope this helps.Thanks for reading