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
what is the difference between a local and a global temporary table? : Sql dba
Is ms sql traffic encrypted?
Can a foreign key have a different name?
What is sql profiler in oracle?
What is a table partition?
What is the least restrictive isolation level? : Transact sql
Does sqlite need a server?
What do you understand by exception handling in pl/sql?
What is the purpose of a secondary key?
Is oracel sql developer written in java?
what are the t string functions available in tsql? : Transact sql
What is restrict in sql?
How to create a menu in sqlplus or pl/sql?
What are tuples in sql?
How is debugging done?