Understanding the RANK and DENSE_RANK Functions in PostgreSQL | Tiger Data