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 are the types of subqueries?
How do I find duplicates in the same column?
What is sql data?
How do I partition in sql?
What are different types of keys?
Can I copy :old and :new pseudo-records in/to an oracle stored procedure?
What is program debugging?
What is the difference between delete and truncate statement in sql?
What can I use instead of union in sql?
What is autocommit sql?
what is isam? : Sql dba
How do I pipe the output of one isql to another?
What are sql commands?
how to run 'mysql' commands from a batch file? : Sql dba
what is a primary key? : Sql dba