This is a document Template
Rank :
  • SELECT empno, ename ,sal, rank() over (order by sal)"Rank" from emp


  • SELECT empno, ename ,sal, dense_rank() over (order by sal)"Rank" from emp
EMP table with three coulmns

Rank : Chewed up  the number rank for the succeeding  column or columns  having a tie with the proceeding one.

DENSE_RANK : The rank number would be shared among the rows rows having ties


PostgreSQL: RANK