MySql select wanted. I have a table with 4 columns labeled id (auto increment), date (date), type (int), sub_type (int), amount (int). The desired result are the records for each type and corresponding subtype with the most recent date entry. Here is an example.
Without the extra complexity of the sub_type the select would be:
SELECT * FROM yourtable s1 WHERE date=(SELECT MAX(s2.date) FROM yourtable s2 WHERE s1.type = s2.type)