Tags / greatest-n-per-group
Understanding and Applying Group By with ROW_NUMBER() Function in SQL Server for Advanced Analytics
Retrieving Top 1 Row per Group: A Flexible Approach to Data Analysis
Querying Single Rows in a Table with Multiple Rows in a Subquery Using Row Number and Aggregate Functions
Retrieving the Latest Record from Duplicate Values Without Grouping in MySQL
Using Arrays for Conditional Aggregation in BigQuery: A Pivot Table Solution
Retrieving the Last Production Quantity from a MySQL Query: Two Solutions with Correlated Subqueries and row_number()
Selecting Customer Names with Maximum Invoice Value Using SQL Joins and Subqueries
Finding the Second Largest Value in a Grouped Dataset Using SQL and Ranking Functions