Skip to content
Advertisement

MYSQL: Get second last record for every customer from a table

my table looks like this

What i am trying to fetch from the list based on second last ID for each customer

Advertisement

Answer

Using ROW_NUMBER is suitable here:

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