Save up to $499! Grab all Python courses for $49 or all online courses we’ve ever launched for only $169. Only Feb 11-16. Happy Valentine's!
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.