Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


find out the third highest salary?

Answers were Sorted based on User's Feedback



find out the third highest salary?..

Answer / hanumantha r challa

select * from emp a where &n=(select count(b.sal) from emp
b where b.sal>=a.sal);

Is This Answer Correct ?    0 Yes 1 No

find out the third highest salary?..

Answer / raghav

select * from (
select Name,
Salary,
Dept,
Rank()over (order by salary desc) RANK
from Employee)
where RANK = 3

Is This Answer Correct ?    0 Yes 1 No

find out the third highest salary?..

Answer / joel

select sal from emp
where sal<(select max(sal) from emp
where sal in (select sal from emp
where sal < ( select max(sal) from emp)))

Is This Answer Correct ?    6 Yes 8 No

find out the third highest salary?..

Answer / sudesh indore

select ( salary) as sal from employee ORDER by
salary DESC limit 2,1

------------
i hope that will help u thanx

Is This Answer Correct ?    0 Yes 2 No

find out the third highest salary?..

Answer / esha gautam

SELECT SAL FROM EMP E WHERE &N-1 =(SELECT COUNT(*) FROM EMP
WHERE E.SAL<SAL);

HERE N FOR NTH SALARY!!!!!!!!!!!!!!!!!!!!

Is This Answer Correct ?    0 Yes 2 No

find out the third highest salary?..

Answer / amrish singh

this is the query for retrieving nth highest salary from
table emp
select e.sal
from emp e
where n-1=(select count(*) from emp s where s.sal>e.sal)

putting the value of n we get the required result.

Is This Answer Correct ?    0 Yes 2 No

find out the third highest salary?..

Answer / venkatranjith e

Hi All,

This query will give you the o/p.

Select * from EMP A where &n= (select count (distinct
(sal)) from EMP B where B.sal>A.sal)

n = 3 , to display 3rd largest salary.

Is This Answer Correct ?    0 Yes 2 No

find out the third highest salary?..

Answer / vishawjeet saini

SELECT MIN(sal) FROM emp WHERE
sal IN (select sal from emp order by sal desc limit 3)

Its works on almost databases including postgres.

Is This Answer Correct ?    0 Yes 2 No

find out the third highest salary?..

Answer / amit singh

forget the book first
Empsal table data
700
500
100
900
400
200
600
750


query to find second highest salary from table Empsal

mysql>select distinct(max(e.salary)) from Empsal e
>where e.salary in(
>select e1.salary from Empsal e1 where e1.salary<(select max(salary) from Empsal));

Output=750



query to find third highest salary from table Empsal


mysql>select distinct(max(e.salary)) from Empsal e
>where e.salary in(
>select e1.salary from Empsal e1 where e1.salary<
>(select max(e1.salary) from Empsal e1
>where e1.salary IN(
>select e2.salary from Empsal e2 where
>e2.salary<(select max(salary) from Empsal))));
Output=700
don't args without run
amitsing2008@gmail.com(amy is back again)

Is This Answer Correct ?    3 Yes 5 No

find out the third highest salary?..

Answer / arungkd

Hey dudes ,

i have worked out this question and got the Answer.... here
it is given below...

SELECT min(income) AS salary FROM [user] WHERE income in
(SELECT DISTINCT top 3 income FROM [user] order by income
desc )

Is This Answer Correct ?    3 Yes 6 No

Post New Answer

More Oracle General Interview Questions

What is save point in oracle database?

0 Answers  


What is a Shared SQL pool ?

2 Answers  


What are ddl statements in oracle?

0 Answers  


Explain can a view based on another view?

1 Answers  


Explain what are the different type of segments?

0 Answers  


Illustrate how to determine the amount of physical CPUs a Unix Box possesses (LINUX and/or Solaris).

0 Answers  


What is Hash Cluster ?

2 Answers  


Describe an oracle table?

0 Answers  


if i am using dml statement in function. then i am writing select statement what was the output

2 Answers   MasterCard,


can anyody please send me the dump for Oracle 10g certifications for DBA path?

0 Answers  


What is the sql query to concatenate column values from multiple rows in oracle?

0 Answers  


i have a table with the columns below as Emp_ID Address_ID Address_Line City Country -------- --------- ----------- ------ --------- Q: Display the Emp_ID's those having more than one Address_ID

7 Answers   IBM,


Categories
  • Oracle General Interview Questions Oracle General (1809)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)