here is the solution for the above problem
select d.department,
case
when (d.maxJan>=d.maxFeb)
and (d.maxJan>=d.maxMarch)
then 'Jan'
when (d.maxFeb>=d.maxJan)
and (d.maxFeb>=d.maxMarch)
then 'Feb'
when (d.maxMarch>=d.maxJan)
and (d.maxMarch>=d.maxFeb)
then 'March'
else 'null'
end as month
from (select department,max(jan_sal) maxJan,max(feb_sal) maxFeb,max(march_sal) maxMarch from mytable group by department)d;