Skip to content
Advertisement

select subset of rows

I have the following table

I want to write a query that ignores the rows with the latest DATE for each NAME

No idea how to write a query like that….

Advertisement

Answer

You can use rank() to rank the rows by descending DATE, then filter out rows with rank = 1 :

Fiddle

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