Hi Assume if you put the surrogate key in target (Dept table) like p_key and version field dno field and loc field is there then
select a.p_key a.dno a.loc a.version from t_dept a where a.version (select max(b.version) from t_dept b where a.dno b.dno) this is the query if you write in lookup it retrieves latest (max) version in lookup from target. in this way performance increases.