Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Simple OVER()
PARTITION BY
Ranking functions
Window frame
Analytic functions
ORDER BY PARTITION BY
Order of evaluation
31. Grouping by ntiles
Summary

Instruction

Precisely so! That's going to be the last question in this part.

Exercise

Divide subscriptions into three groups (buckets) based on the payment_amount. Group the rows based on those buckets. Show the following columns: bucket, minimal payment_amount in that bucket and maximal payment_amount in that bucket.

Stuck? Here's a hint!

Use NTILE(3) in a subquery and rename it to bucket. In the outer query, use it to group the rows.