Write a query to find second highest salary of an employee.

Answer Posted / gyana ranjan behera

select ename,sal.rn from(select ename,sal,rownum rn from(select ename,sal from emp order by sal desc))where rn=2;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are user defined functions?

581


Explain what is a column in a table?

573


What is difference between hql and native sql?

585


Is it possible to read/write files to-and-from PL/SQL?

655


Can a trigger call a stored procedure?

537






what are rollup and cube in t-sql? : Transact sql

661


How do you delete duplicates in sql query using rowid?

542


Explain clause in sql?

564


how to use myisamchk to check or repair myisam tables? : Sql dba

509


Why do we use %rowtype & %type in plsql?

610


How do I run a query in pl sql developer?

562


What types of commands can be executed in sql*plus?

554


When do we use triggers?

585


How do you update a table in sql?

519


how to create a table index in mysql? : Sql dba

597