Suppose we have 3 employees in each department.we have total 3 departments . Below is the sample source table
Emp deptno salary A 10 1000 B 10
select min(salary),deptno from (SELECT distinct top 2 salary,deptno from table ORDER BY salary DESC) as a group by deptno