Monday, 12 March 2012

Second Highest Salary From a table( such as Employee Table)

Sometimes it requires to find the second most from a column(say second highest salary from employee table) in a table, to do it write the Query below:

select max(salary) from employee where salary not in (select max(salary) from employee );

No comments:

Post a Comment