I have a database that contains duplicated names and timestamps I want to retrieve the record whose timestamp is the lowest grouped by the name.
table : people
+------------+-------------+
| Name | Timestamp |
+------------+-------------+
| name1 | 0 |
| name1 | 5 |
| name2 | 2 |
| name3 | 3 |
| name2 | 1 |
+--------------------------+
With a database in this state the query should return "name2, 2" since the highest value for name2 is the lowest of the max value of all groups.
I've been thinking a lot about this since I know I've done similar queries but my SQL skills are too rusty.
Thanks to anyone that takes the time to help :)