@herminia_bruen
To get the top row for each group in a column in MySQL, you can use the following query with a combination of subqueries:
1 2 3 4 |
SELECT t1.* FROM your_table t1 LEFT JOIN your_table t2 ON t1.group_column = t2.group_column AND t1.column > t2.column WHERE t2.column IS NULL; |
Here's how the query works:
Replace your_table
with the actual name of your table, and group_column
and column
with the respective column names in your table.