find out the third highest salary?
Answers were Sorted based on User's Feedback
Answer / divya
select min(sal) from salarytbl where sal in(select distinct
top 3 sal from salarytbl order by sal desc)
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / shivaprasad
select distinct top 1 Salary from(select distinct top 3
Salary from Employee order by Salary DESC)temp order by
Salary;
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / paridhi
select top 1 salary from
(select top 1 salary from employee order by
salary desc) a
order by salary
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / santanu
3rd highest salary:
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 / shashi kumar
Select * from emptable e1 where(N=(select
count(DISTINCT(e2.empsal))from emptable e2 where
e2.empsal>=e1.empsal))
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / nitin berwal
select top 1 salary from(select top 3 salary from emp order
by desc) a
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / deepal saini
this is the best way to find out thethird highest salary from emp table
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 / gaurav
try this
select max(salary)
from employees
where salary < (select max(salary)
from employees
where salary < (select max(salary)
from employees));
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / prithvi
select Max(sal) from emp
This will give us 1highest sal
Select Max (sal) from where sal <(select Max(sal) from emp)
Select Max (sal) from where sal <(Select Max (sal) from
where sal <(select Max(sal) from emp))
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / siddharth mitra
select *
from (select row_number() over (order by salary asc) as
"ROW_NUM" from emp)
where ROW_NUM = 3;
This only works with oracle 8i and 9i,i.e., row_number is an
analytic function.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is an oracle user role?
You have 4 instances running on the same UNIX box. How can you determine which shared memory and semaphores are associated with which instance?
What is TNS File
How to save query output to a local file?
What privilege is needed for a user to create tables in oracle?
Explain can a view based on another view?
How to select some columns from a table in oracle?
Explain an exception?
What is index in Oracle?
Is there any way to find out when one specific table/view/M-view is used last time. i.e. when one specific object is used in any SELECT statement.
how to get required data from oracle source is like this ram_05_seetha lax_05_viswa bamr05frummy run_01_away sw_sas_trim i want my target data like ram_05_seetha lax_05_viswa to get data using %_05_% but it will give ram_05_seetha lax_05_viswa bamr05frummy how can i get my target data?
How can I introduce multiple conditions in like operator?