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 cursor and its types?
What is not null in sql?
What are the advantages of pl sql?
What is number function in sql?
How do you explain an index?
How global cursor can be declare with dynamic trigger ?
Does mysql_real_escape_string prevent sql injection?
Explain commit, rollback and savepoint.
what is auto increment? : Sql dba
Name the operator which is used in the query for pattern matching?
What is the sql case statement?
What will you get by the cursor attribute sql%found?
Explain ddl statements in pl/sql?
What does pl sql developer do?
What is tuple in sql?