Find out the 3rd highest salary?
Answers were Sorted based on User's Feedback
Answer / ritesh sabanis
select max(sal) from employeedata where sal <
(select max(sal) from employeedata where sal not in(select
max(sal)from employeedata)) ;
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / divya c
Select max(sal) from emp
where sal<(select max(sal) from emp where sal<(select max
(sal) from emp));
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / lalit dwivedi
select a.salary
from emp a
where 3=(select count(distinct(b.salary))
from emp b
where a.salary<=b.salary)
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / dharmendra yadav
select min(salary) from (select name , salary , rownum from
Emp order by salary desc) where rownum <= 3 ;
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / jeevitha
select distinct a.salfrom emp a where &n= (select count
(distinct(b.sal)from emp b where a.sal<= b.sal)
-----
enter the highest sal of n:2,3.....n
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / suba
(Instead of 3 we can find N highest value)
select min(sal) from emp e where 3>(select count(sal) from
emp where sal>e.sal);
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / kumar
select*from(select rownum rn,sal from(select*from emp order by sal desc))where rn=3
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / aarti verma
get the 3rd highest salary:
SELECT DISTINCT salary from employee e ORDER BY salary DESC
LIMIT 2,1;
get the records of employees having 3rd highest salary:
SELECT * FROM employees WHERE salary = (SELECT DISTINCT
salary from employee e ORDER BY salary DESC LIMIT 2,1);
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / himanshu
SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP 3 salary
FROM employee
ORDER BY salary DESC) a
ORDER BY salary
| Is This Answer Correct ? | 0 Yes | 0 No |
SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP 3 salary
FROM employee
ORDER BY salary DESC) a
ORDER BY salary
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the meaning of disabling a trigger?
how to insert values like 10:10:00,30:25:00 etc.into table after insert how can i sum the above insert values to get the result as 40:35:00
What is difference between group by and partition by?
State some properties of relational databases?
What is INSTEAD OF trigger ?
What is the main difference between sql and pl/sql?
What are tuples in sql?
What is sql profiling in oracle?
Does oracle use sql?
How to copy a table in another table with datas?
What are all the common sql functions?
What is difference between a PROCEDURE & FUNCTION ?
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)