Introduction
Simple OVER()
PARTITION BY
Ranking functions
Window frame
22. Window frame – Exercise 4
Analytic functions
ORDER BY PARTITION BY
Order of evaluation
Summary

Instruction

Ok! Let's do the last exercise.

Exercise

For each single rental, show the following information: rental_date, title of the movie rented, genre of the movie, payment_amount and the highest payment_amount for any movie in the same genre rented from the first day up to the current rental_date.

Stuck? Here's a hint!

You will need to use both PARTITION BY to group rentals by the genre and ORDER BY to sort them by the rental_date. Join tables movie and single_rental.

Console

Code editor

Result

TableConsole