OK, let's say I have a table of patients, and a table of illnesses that those patients have suffered from like so...
Table 1
Patient ID (PK) Patient Name
=============================================
001 Arthur
002 Brian
003 Candy
Table 2
ID (PK) Patient ID Illness
==============================================
1 001 Flu
2 001 Sore Throat
3 001 Measles
4 002 Mumps
5 002 Flu
6 003 Cold
7 003 Measles
Now I want to create a query so that I have a list of each patient with their most recent illness, like
Arthur Measles
Brian Flu
Candy Measles
How do I do that? I think it would be like the following (pseudo code)
SELECT * FROM table1, table2 LEFT JOIN USING 'Patient ID' WHERE (and this is where I get stuck) the Illness ID for a particular patient is the biggest.
Thanks for any help!