I came across this article at 4GuysFromRolla. They spoke about OVER, RANK, DENSE_RANK in SQL Server 2005. SQL brought in these functions (oh yeah oracle had it since i was wearing nappies). Though i used RANK’s in Oracle, i didn’t really understand the difference before.
- OVER – gives sequential numbers
- RANK – gives ranks to records, so more than a record may have same rank
- DENSE_RANK – same as ranks, but will continue the ranking number, but rank will skip ranks when more than a record gets same rank.