Trying to figure out if there is a MySQL query for the following scenario:
Database example
id---fruit------date
01---apple------1990-01-01
02---banana-----2020-01-01
03---orange-----2021-02-03
04---apple------1999-12-12
05---pear-------2009-01-02
06---apple------2008-09-18
07---banana-----2007-11-12
I want a query to return all rows but for rows with the same fruit only one occurence and preferably the occurence with the latest date. So based on the above the query would return:
id---fruit------date
02---banana-----2020-01-01
03---orange-----2021-02-03
05---pear-------2009-01-02
06---apple------2008-09-18