Lesson 9.4 · Pro
Rank, then put the winners side by side
Combine ranking with MAX(CASE) to show first, second and third (or best and worst) in one row.
In this lesson
- Rank both ways in one CTE
- Pick each winner with MAX(CASE)
- Top 3 as columns
Go Pro to read this lesson
Pro unlocks every lesson and practice problem in SQL, Python, pandas and NumPy, with answers and step-by-step explanations.