How to get second highest salary from a table
Answers were Sorted based on User's Feedback
Answer / senthil
select max(sal) from emp where sal <(select max(sal) from emp)
Is This Answer Correct ? | 13 Yes | 1 No |
Answer / srinivas
select * from emp m where(select count(distinct sal)+1 from emp s where s.sal>m.sal)=2
Is This Answer Correct ? | 7 Yes | 3 No |
Answer / saiz
select min(salary)
from emp
where salary in ( select top 2 salary
from emp
order by salary desc);
Is This Answer Correct ? | 3 Yes | 0 No |
What is the use of stored procedures?
what is global table
Do triggers have restrictions on the usage of large datatypes, such as long and long raw?
how to shutdown mysql server? : Sql dba
Do view contain data?
How can I speed up sql query?
7. Where would you look for errors from the database design?
what are the differences between procedure-oriented languages and object-oriented languages? : Sql dba
I need a function for a train ticket reservation please answer it thanks in advance
What is nested table in pl sql?
What is difference between procedure and trigger?
Can a table contain multiple primary key’s?