Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Simple OVER()
PARTITION BY
Ranking functions
17. Ranking Functions – Exercise 3
Window Frames
Analytic Functions
PARTITION BY ORDER BY
Order of Evaluation
Finished!

Instruction

Excellent! This is the next-to-last exercise for ranking functions.

Exercise

Show the first and last name of the customer who bought the second-most-recently-purchased GiftCard. Show the payment date also. Assume that an individual rank is assigned for each gift card purchase.

Stuck? Here's a hint!

Use a CTE:

WITH Ranking AS (...) SELECT ...

And pick the row with Rank = 2.