I believe the following will work if you are using Oracle:
select a.empl_uno,
a.rate,
a.eff_date,
a.last_modify
from rate a, (SELECT empl_uno, max(eff_date) max_date
FROM rate
GROUP BY empl_uno) b
where a.eff_date = b.max_date;
This should be more efficient since it eliminates the correlated subquery.




Reply With Quote