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 );
select max(salary) from employee where salary not in (select max(salary) from employee );
No comments:
Post a Comment