Skip to content
Advertisement

For each product get the second customer who made a purchase

Given a table:

Question: For each product get the second customer who made a purchase

The following query

Gives the result:

And the expect result is:

Here is the script to create a table:

Advertisement

Answer

You need to pair down the customers first so there is only one record per customer:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement