how to find the second highest salary from emp table?

Answer Posted / gourvendra singh

Please put the below query, u will get the second highest
salary of the table :---

select sal from(select sal from
(select distinct sal from emp order by sal desc)
where rownum<=2 order by sal asc)
where rownum=1;

Is This Answer Correct ?    488 Yes 264 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Who developed sql?

566


How do I install microsoft sql?

526


Which is better stored procedure or query?

544


What is the execution plan in sql?

554


How to start the command-line sql*plus?

562






What is difference between joins and union?

529


what is the command used to fetch first 5 characters of the string? : Sql dba

1132


What is $$ in sql?

549


Can we use delete in merge statement?

512


What is mutating error?

502


What action do you have to perform before retrieving data from the next result set of a stored procedure ?

2089


what is sp_pkeys? : Transact sql

699


Why are aggregate functions called so?

507


Explain correlated query work?

589


How many types of relationship are there?

545