Tables...
contracts
---------
id
contract_locations
------------------
id
contract_id # A contract can have many contract locations.
name # E.g., "Front office", "Legal", "Contracts admin", etc.
arrival_date
Users consider the location with the last arrival_date
to be a given contract's "current location".
They want to be able to find all contracts with a current location name
equal to (for example) "Front office" or "Legal".
How can I write a MySQL 5.1 query to do that?