how to get second highest salary in SQL(as/4000
Answer Posted / selvaspak
select sal from (select sal,rank() over(order by sal desc)
as rank from emp) where rank = &no
Actually for this Question there are having lot of method
to get the result, but the interviewer is asking this for
to check whether the interview person know the RANK()
function or not. So the above query is correct
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How do I view a table in sql?
Explain ttitle and btitle.
Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me
What is left inner join in sql?
What are %type and %rowtype for?
Explain the methods used to protect source code of pl/sql.
How to execute a stored procedure?
What is difference between mysql and postgresql?
Explain polymorphism in pl/sql.
Explain the advantages and disadvantages of stored procedure?
What does varchar include?
What is pl sql record in oracle?
What is data types in sql?
what are the advantages and disadvantages of cascading style sheets? : Sql dba
What is a recursive stored procedure?