Problems / Complex Partitioning / Editorial
This problem demonstrates that multiple window functions with different partitioning can coexist in a single query.
customer_id
category
All three use ORDER BY amount DESC so the highest-value order gets rank 1 in each context. The same order can have very different ranks depending on the partition context.
ORDER BY amount DESC
Solve Complex Partitioning yourself →