I have a table ordered by fruit and date resulting from a join such as the following:
+--------+------------+
| fruit | date |
+--------+------------+
| apple | 2002-02-02 |
| apple | 2003-03-03 |
| banana | 2001-01-01 |
| banana | 2003-03-03 |
| banana | 2022-02-02 |
+--------+------------+
How do I extract the earliest date for each fruit? The result should be
+--------+------------+
| fruit | date |
+--------+------------+
| apple | 2002-02-02 |
| banana | 2001-01-01 |
+--------+------------+
GROUP BYandMINand was then able to doSELECT name,MIN(date) FROM fruit GROUP BY name;– loris Sep 22 '22 at 08:43