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 the third highest salary?

Answers were Sorted based on User's Feedback



find the third highest salary?..

Answer / selvaraj v, anna university co

Find the HIGHEST SALARY in Employee Table :
-------------------------------------------

select * from emp where sal=(select max(sal) from emp)
order by empno;


Find the 3'rd HIGHEST SALARY in Emp Table :
-----------------------------------------------

SELECT * FROM EMP e WHERE 3=(SELECT COUNT(*) FROM EMP x
WHERE x.SAL>=E.SAL);

It's e,x are ALIAS NAME of EMP Table.

Is This Answer Correct ?    14 Yes 2 No

find the third highest salary?..

Answer / noorulahaq

select min(sal) from emp where sal in (
select sal from
( select sal from emp order by sal desc )
where rownum <=3 )

Is This Answer Correct ?    26 Yes 17 No

find the third highest salary?..

Answer / rohit kumar

select min(sal) from (select sal from emp order by sal
desc) where rownum <= 3

Is This Answer Correct ?    17 Yes 8 No

find the third highest salary?..

Answer / uday kiran

Its is like Nth highest salary.....


Select * from Employee where salary =
(Select max(Salary) from Employee where salary < (Select max
(Salary) from Employee where
Salary<(Select max(Salary) from Employee where
Salary <…………………………………………… N

Is This Answer Correct ?    15 Yes 10 No

find the third highest salary?..

Answer / nripesh agarwal

select * from emp where salary=(select distinct salary from
emp order by salary desc limit n,1)


// for Nth highest value put n=N-1....
//for 3rd highest put n=2........

Is This Answer Correct ?    7 Yes 2 No

find the third highest salary?..

Answer / srinath reddy

select * from emp e1 where 3 = (select count(*) from emp e2
where e1.salary <= e2.salary);

instead of answer we can say this as a solution where we can
find nth also

Is This Answer Correct ?    4 Yes 0 No

find the third highest salary?..

Answer / imran ansari

find n th highest salary replace n with 1,2,3....to find second,third,fourth........sal
SELECT sal from emp order by sal desc limit 2,1

Is This Answer Correct ?    3 Yes 0 No

find the third highest salary?..

Answer / nripesh agarwal

select * from emp where salary=(select salary from emp
order by salary desc N,1);


// Put the value for N as for Nth highest salary
// e.g. for 2nd put N=2 , for 3rd put N=3 and so on...

Is This Answer Correct ?    3 Yes 1 No

find the third highest salary?..

Answer / chandra sekhar

SELECT * FROM EMP e
where 3=(select count(*) from emp
where e.sal<=sal)

Using this correlated subquery we can easily get any one

Is This Answer Correct ?    2 Yes 0 No

find the third highest salary?..

Answer / kiran

select salary from employees e where 3 = (select count
(distinct salary) from employees f where
e.salary <= f.salary);

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

what is table? : Sql dba

0 Answers  


What type of join is sql join?

0 Answers  


How would you convert date into julian date format?

0 Answers  


what is row? : Sql dba

0 Answers  


What are operators available in sql?

0 Answers  


How are functions and procedures called in PL/SQL?

0 Answers  


1 SELECT a.field1, b.field2, c.field3, d.field4 2 FROM atable a, atable b, ctable c, dtable d 3 ? 4 ORDER BY 1 What is the minimum number of joins that must be specified on line 3 in the sample code above to properly link the tables? Notice that the table "atable" is aliased twice: once as "a" and once as "b." 1. One join 2. Two joins 3. Three joins 4. Four joins 5. Five joins

6 Answers   Sonata,


How can one get sql*loader to commit only at the end of the load file? : aql loader

0 Answers  


declare l1 number := null; l2 number :=null; begin if l1=l2 then message('equal'); else if l1<>l2 then message('not equal'); else message('else'); end if; end if; end; What will be the output ?

7 Answers   Oracle,


How can I pass the inner procedure value to outer procedure ?

2 Answers  


Can a view be mutating? If yes, then how?

0 Answers  


What is difference between inner join and self join?

0 Answers  


Categories