update mre set F042Trekmp = (select top 1 tr.F042TrekmpID from ies.T_F042_TREKMP tr
join ies.T_F004_EXPERT ex on tr.N_EXPERT = ex.N_EXPERT
where ex.N_EXPERT = mre.F004Expert
order by tr.DATEBEG DESC)
from ies.T_MEDICAL_REQUEST_EXPERT mre