Find out the 3rd highest salary?
Answers were Sorted based on User's Feedback
Answer / tathagoto
select sal from (select sal from salary order by sal desc)
where rownum <4;
| Is This Answer Correct ? | 1 Yes | 4 No |
Answer / santosh
select level,max(sal) from emp where level=3 connect by
prior sal>sal
group by level;
| Is This Answer Correct ? | 0 Yes | 3 No |
Answer / sachin
select * from ( select * from (select * from emp order by
sal desc)
where rownum<=3
order by rownum desc)
where rownum=1
| Is This Answer Correct ? | 1 Yes | 4 No |
Answer / xyz
select a.sal from (select distinct(sal) from emp order by
sal desc)a where rownum=3
| Is This Answer Correct ? | 2 Yes | 7 No |
Answer / srijith pillai
This will give you third highest salary
select ename, sal from
(Select name, sal, rownum()Over(Order by sal Desc) rt
FROM emp)
where rt = 3;
| Is This Answer Correct ? | 13 Yes | 19 No |
Answer / manoj
SELECT min(salary)
FROM (
SELECT e.salary , ROWNUM
FROM emp e
ORDER BY salary DESC
AND ROWCOUNT <=3
)
ROWNUM =3;
| Is This Answer Correct ? | 3 Yes | 9 No |
Answer / umesh naik
select max(amount) from (
select distinct amount from temp123
where rownum <= 3
)
| Is This Answer Correct ? | 1 Yes | 8 No |
Answer / s.dineshkumar
Select Top 1 Salary from (Select top 3 Salary from Employee
order by salary desc ) a
| Is This Answer Correct ? | 0 Yes | 7 No |
Answer / shaiju nair
select min(sal) from (Select sal
FROM emp where rownum<=3
Order by sal desc)
| Is This Answer Correct ? | 13 Yes | 25 No |
What is schema in sql example?
What is the Query to print out the individual total number of duplicate row in sql.
how can i create a user defined datatype
Which are the most commonly used sql joins?
how can we repair a mysql table? : Sql dba
what is purge command explain about oracle performance tuning
2 Answers Accenture, eCentric Solutions,
How do I find duplicates in two columns?
Is sql microsoft?
How many sql databases can you have on one server?
in oracle 10g sw after compiling procedure how to pass parameter values ,if we (v_empid out number)how to give empid after successful compilation program.This site exact suitable for 10g with respect to question & answer same format , im trying sql browser & sql command prompt using exec procedure name & respective parameters.
What are the different types of PL/SQL program units that can be defined and stored in ORACLE database ?
List the various privileges that a user can grant to another user?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)