Saturday, January 14, 2012

SQL Query to get Second Highest Salary of the Employee


SELECT min(salary) AS high5 FROM employee WHERE salary IN(SELECT DISTINCT TOP 5 salary FROM orders ORDER BY salary DESC)

1 comment:

  1. SELECT min(salary) FROM employee WHERE salary IN(SELECT DISTINCT TOP 5 salary FROM orders ORDER BY salary DESC)

    ReplyDelete