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
Very simple logic.
Please try:
SELECT dept as dd, ( SELECT ee.salary FROM `employees` as ee WHERE ee.dept=dd ORDER BY ee.salary DESC LIMIT 1,1 ) as sndHigh FROM `employees` WHERE 1 GROUP BY dept