There are two tables:
contract (with primary key
contractupdate (with field
contractid referring to a contract).
contractupdate also has DATE field
startdate and TINYINT field
I want the list of contract IDs ordered by the value of field
day in the latest (having maximal
startdate) contract update which refers to this contract.