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...


how to check the 3rd max salary from an employee table?

Answers were Sorted based on User's Feedback



how to check the 3rd max salary from an employee table?..

Answer / akula

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

Is This Answer Correct ?    1 Yes 0 No

how to check the 3rd max salary from an employee table?..

Answer / dulal

Without Using MAX or MIN keyword


select TOP 1 EmpName, RevisedMinutes
from tblEncounter
where RevisedMinutes IN(select distinct Top 3
RevisedMinutes from tblEncounter order by RevisedMinutes
desc)
order by RevisedMinutes asc

Is This Answer Correct ?    2 Yes 2 No

how to check the 3rd max salary from an employee table?..

Answer / srinivas

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

how to check the 3rd max salary from an employee table?..

Answer / kotesh

select level,max(salary) from employee
where level=3
connect by prior salary>salary
group by level;

Is This Answer Correct ?    0 Yes 0 No

how to check the 3rd max salary from an employee table?..

Answer / pavan ranga

select top 1 (salary),Name from customers
where salary not in (Select top 2 (Salary) from customers)

Is This Answer Correct ?    0 Yes 0 No

how to check the 3rd max salary from an employee table?..

Answer / a.brahmam

select * from(select rownum r,sal from(select * from table name order by sal desc))
where r=3;
(or)
select * from(select rownum,sal from table name order by sal desc)
where rownum<=3
minus
select * from(select rownum,sal from table name order by sal desc)
where rownum<=2
(or)
select * from(select sal,dense_rank()over(order by sal desc)r from table name)
where r=3

Is This Answer Correct ?    0 Yes 0 No

how to check the 3rd max salary from an employee table?..

Answer / rutujagabhane

SELECT *
FROM(
SELECT SALARY, DEPARTMENT_ID,EMPLOYEE_ID, DENSE_RANK() OVER (PARTITION BY DEPARTMENT_ID ORDER BY SALARY DESC) AS RN
FROM EMPLOYEES
)
WHERE RN = 2
;

Is This Answer Correct ?    0 Yes 0 No

how to check the 3rd max salary from an employee table?..

Answer / neeraj

SELECT TOP 1 * FROM [SELECT TOP 3 * FROM Emp_Salary
ORDER BY Salary DESC;]
ORDER BY Salary;

Is This Answer Correct ?    3 Yes 4 No

how to check the 3rd max salary from an employee table?..

Answer / akilis.org@hotmail.com

Let us Assume
Table Name=salary
Column Name=maxsal

select * from salary order by maxsal desc limit 2,1;

Enjoy the simple code :)

Is This Answer Correct ?    1 Yes 2 No

how to check the 3rd max salary from an employee table?..

Answer / kumar sumit

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

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More SQL PLSQL Interview Questions

Is sql better than access?

0 Answers  


What is keys and its types?

0 Answers  


what is Difference between Having and Where clause?

5 Answers   IBM,


What is the difference between sql, mysql and sql server?

0 Answers  


wirte a query to remove null? following table are col1 col2 col3 dinesh null null null suresh null null null prakesh i want the output like col1 col2 col3 dinesh suresh prkaesh

6 Answers   TCS,


what is difference between "Primary key" and "Unique key"?

4 Answers   PreVator,


Define select, insert, create, delete, update, drop keywords

0 Answers  


What does the acronym acid stand for in database management?

0 Answers  


How many functions are there in sql?

0 Answers  


Is left join same as inner join?

0 Answers  


How to sort the rows in sql.

0 Answers  


Explain how procedures and functions are called in a PL/SQL block ?

3 Answers  


Categories