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
24. Analytic functions – Exercise 2
ORDER BY PARTITION BY
Order of evaluation
Summary

Instruction

Piece of cake for you! Maybe the next one will be of some challenge?

Exercise

For each single rental, show the following columns: id, payment_date, payment_amount, the payment_amount of the previous single_rental in terms of the payment_date and the difference between the last two values.

Stuck? Here's a hint!

Use LAG(payment_amount) and order by the payment_date.