PostgreSQL - Window Functions in PostgreSQL
You want to assign ranks to employees based on their sales, but you want no gaps in ranking numbers even if some employees have the same sales. Which function should you use and why?
Options:
A)
B)
C)
D)
Options:
A)
ROW_NUMBER() because it gives unique numbers.B)
RANK() because it skips ranks after ties.C)
DENSE_RANK() because it assigns ranks without gaps after ties.D)
COUNT() because it counts rows.