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.

Console

Code editor

Result

TableConsole