PostgreSQL - Window Functions in PostgreSQL
How would you modify this query to rank students by score within each class, but ensure no gaps in ranks?
SELECT student_id, class_id, RANK() OVER (PARTITION BY class_id ORDER BY score DESC) AS rank FROM students;
