I want to find the last inserted row that matches a query (ie, find the row that has the largest id among the matching rows.)
for instance, suppose the following query matches 3 rows. with ids, 1,2,and 3. I want to get only the row with id 3.
SELECT * FROM `table` WHERE `mail` = '[email protected]'
How do I do this?