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
Does oracle use sql?
What is the maximum database size for sql express?
what is unique key constraint? : Sql dba
What is null in pl/sql?
What does the hierarchical profiler does?
which operator is used in query for pattern matching? : Sql dba
how would you get the current date in mysql? : Sql dba
Can a view be mutating? If yes, then how?
What is the difference between mdf and ndf files?
What is the difference between left join and right join?
describe mysql connection using mysql binary. : Sql dba
What is data manipulation language?
what are integrity rules?
What is scalar and vector?
How does an execution block start and end in pl sql?