Tags / greatest-n-per-group
Understanding the Limitations of ROW_NUMBER() and Finding Alternative Solutions for Partitioned Data
How to Use Lateral Joins to Get the Most Recent Exchange Rate for Each Transaction in PostgreSQL
Using Window Functions in MySQL: Fetching Last N Rows for Multiple Users
Filtering Records by a Combination of Two Columns