write a query to find the third maximum salary of a
employee.(table:employ col name:salary)
Answers were Sorted based on User's Feedback
Answer / ravindra
select max(sal) from emp where level=3 connect by prior sal>sal;
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / shrikant
SELECT MIN(sal) FROM emp WHERE
sal IN (SELECT distinct TOP 3 sal FROM emp ORDER BY sal
DESC)
select max(sal) from emp where sal<(select max(sal) from emp
where sal<( select max(sal) from emp));
select * from emp e
where 3 = (select count(sal) from emp
where e.sal < sal);
Select * from EMP_USER A where n-1 = (select count
(distinct (sal)) from EMP_USER B where A.sal<B.sal)
| Is This Answer Correct ? | 4 Yes | 2 No |
Answer / saiprasanna
select max(salary) from employ
where salary=(select max(salary) from employ where salary
<(select max(salary) from employ));
| Is This Answer Correct ? | 5 Yes | 3 No |
Answer / jithendranath.g
SELECT Z2.SAL FROM EMP Z1,EMP Z2
WHERE
Z2.SAL <=Z1.SAL
GROUP BY Z2.SAL
HAVING COUNT(Z2.SAL)=3
| Is This Answer Correct ? | 3 Yes | 2 No |
select e.ename,a.sal from (select sal, rownum rnum ,rowid
rid from (select * from emp order by sal desc)) a , emp e
where a.rid= e.rowid
and a.rnum = 3
| Is This Answer Correct ? | 1 Yes | 0 No |
select ename,sal from (select rownum rnum ,rowid rid from
emp order by sal desc) a , emp e
where a.rnum = 4
and a.rid= e.rowid
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / suresh
Select emp.*,dense_rank()over(order by sal desc) rn from emp
where rn=3;
| Is This Answer Correct ? | 1 Yes | 3 No |
What is the sql query to find the employee who has Nth maximum salary?
What is the Symbol use for Inner Join
how to display last 5 letters from a name (take emp table ename )
How to find locks exists in a table or not?
Whats the purpose of using Nextval while creating the sequence.
What is the difference between the SQL*Loader and IMPORT utilities?
What is the technical flow associated with P2P or Procure to Pay cycle like the tables, APIs, concurrent programs involved in this cycle. Only technical please.
HOW TO SAVE UNIVERSES AND DOCUMENTS IN THE REPOSITORY?
What is auto accounting what are the steps for setting up auto accounting? : oracle accounts receivable
What are the standard concurent programs for auto invoice interface and customer interfaces? : oracle accounts receivable
Hi I am searching for best oracle Apps institute? Please tel me which is best institute in hyderabad I am working in developer 6i....
I need a Technical evaluation between Oracle and SAP ? please do a need ful.