If you can avoid correlated subquery, the better the performance, example of non-correlated subquery:
SELECT a.meg,a.currency
FROM alt6sal a
join
(
select ia.emp_num, max(ia.sal_year) as sal_year_max
from alt6sal ia
group by ia.emp_num
) the_year_max
on a.emp_num = the_year_max.emp_num and a.sal_year = the_year_max.sal_year_max
join
(
select ia.emp_num, ia.sal_year, max(ia.sal_mon) as sal_mon_max
from alt6sal ia
group by ia.emp_num, ia.sal_year
) the_month_max
on a.emp_num = the_month_max.emp_num and a.sal_year = the_month_max.sal_year
and a.sal_mon = the_month_max.sal_mon_max
WHERE a.meg_code IN (1,2)
Analogous non-correlated JOINS for OR instead of AND, use LEFT JOIN then filter-in non-null
SELECT a.meg,a.currency
FROM alt6sal a
left join
(
select ia.emp_num, max(ia.sal_year) as sal_year_max
from alt6sal ia
group by ia.emp_num
) the_year_max
on a.emp_num = the_year_max.emp_num and a.sal_year = the_year_max.sal_year_max
left join
(
select ia.emp_num, ia.sal_year, max(ia.sal_mon) as sal_mon_max
from alt6sal ia
group by ia.emp_num, ia.sal_year
) the_month_max
on a.emp_num = the_month_max.emp_num and a.sal_year = the_month_max.sal_year
and a.sal_mon = the_month_max.sal_mon_max
WHERE a.meg_code IN (1,2)
and
(the_year_max.ia_emp_num is not null
or the_month_max.ia_emp_num is not null)