I tried this statement but seems like "top 2" is not accepted.
select min(Salary) from ( select Top 2 Salary from Employee group by Salary order by Salary DESC )
Anyone can advice the reason?
If I'm not wrong, it's only using MySQL as the DB, where "TOP 2" is not correct syntax. Use "LIMIT 2" instead (http://dev.mysql.com/doc/refman/5.0/en/select.html).
And your solution had other bug. You may want to debug on your own.