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


write a query for the fifth highest salary?

Answers were Sorted based on User's Feedback



write a query for the fifth highest salary?..

Answer / venkates

select distinct(a.sal) from emp a where 5=(select
count(distinct(b.sal)) from emp b where a.sal<=b.sal)

Is This Answer Correct ?    22 Yes 2 No

write a query for the fifth highest salary?..

Answer / nitin bisht

SELECT empSalary FROM empTable e1 WHERE (5 = (SELECT
COUNT(DISTINCT (e2.empSalary))
FROM empTable e2 WHERE e2.empSalary >= e1.empSalary))

Is This Answer Correct ?    13 Yes 0 No

write a query for the fifth highest salary?..

Answer / skumar

Hi, friends This one is working fine. I have tested.

SELECT TOP 1 t.esal
from
(
select top 5 esal from employee order by esal desc
) t
order by t.esal asc

Is This Answer Correct ?    9 Yes 6 No

write a query for the fifth highest salary?..

Answer / piyush gupta

select distinct(a.sal) from emp a where 5=(select
count(distinct(b.sal)) from emp b where a.sal<=b.sal)


you can this query for nth highest salary
replace 5 with any number

Is This Answer Correct ?    2 Yes 0 No

write a query for the fifth highest salary?..

Answer / prasanna

select max(sal) from emp where sal not in (select Top 4 sal
from emp order by sal desc)

Is This Answer Correct ?    1 Yes 0 No

write a query for the fifth highest salary?..

Answer / shahid

select *from(select sal,rank() over(order by sal desc)as sal_rank from emp) where sal_rank=5;

Is This Answer Correct ?    1 Yes 0 No

write a query for the fifth highest salary?..

Answer / bhramar

select top 1 Sal from(select distinct top 5 Sal from TestEmp order by Sal desc) a order by Sal

Is This Answer Correct ?    1 Yes 0 No

write a query for the fifth highest salary?..

Answer / suparna

select salary from employee e where 4=(select count(*) from
emp f where e.sal<f.sal)

Is This Answer Correct ?    8 Yes 8 No

write a query for the fifth highest salary?..

Answer / chethan

select Salary from ( select salary from emp order by desc) as employee where rownum = 5;

Is This Answer Correct ?    0 Yes 0 No

write a query for the fifth highest salary?..

Answer / bezalel

select salamt from
(
select rownum n,salamt from
(
select distinct salamt from emp order by salamt desc
)
)
where n=5

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Databases AllOther Interview Questions

utility used to obtain inform regarding the optimizes choice of access strategy for SQL stmts A) LOAD B) REORG C) COPY D) EXPLAIN

2 Answers   Accenture,


how can you perform lookup range in lookup stage expalin in detail?

0 Answers   IBM,


what is vlook up in ms excel and how does it used???

1 Answers   CybAge,


What are database connection details?

0 Answers  


How to do performance tunning a database in DB2 V8.2 UDB in linux

0 Answers  


After normalization, what are the conditions which have to keep in mind to de-normalize it?

0 Answers   C DAC, CDAC,


How to implement database security?

0 Answers  


What is database server and how it works?

0 Answers  


What is the difference between database and server?

0 Answers  


How many types of normalization? What is the use of it?

0 Answers   Accenture,


What is difference between clustered, non-clustered and unique index?

0 Answers   Abacus,


What is dialect in database?

0 Answers  


Categories