• Okay with that data all you need is a Group By and a Max(PurchaseDate)

    Select

    product_id,

    product_name,

    Max(purchase_date) as last_purchase_date

    From

    table

    Group By

    product_id,

    product_name