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 many sql commands are there?
What is the use of index in hive?
what are all the common sql function? : Sql dba
Why is theta join required?
State some properties of relational databases?
list out some tools through which we can draw e-r diagrams for mysql. : Sql dba
What are the different schemas objects that can be created using pl/sql?
What is package in pl sql?
What is materialized view. What are different methods of refresh?
What is java sql package?
Is it important to partition hard disk?
What are some predefined exceptions in pl/sql?
How would you convert date into julian date format?
What is cross join sql?
what is the difference between delete and truncate commands? : Sql dba