e.g. select * from rate where id = ? and rate.date_effective = (select max(date_effective) from rate down_the_way where down_the_way.id = ?)