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 to find 4th max salary

Answers were Sorted based on User's Feedback



write a query to find 4th max salary..

Answer / raj

for example if we take emp table:

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

Is This Answer Correct ?    3 Yes 1 No

write a query to find 4th max salary..

Answer / debashis mohanty

Select Name,Deptno,Salary,Rank from
(
Select Ename Name,Deptno,Sal Salary,Rank () over(Order By Sal Desc) Rank from emp
)
Where Rank=4

Is This Answer Correct ?    2 Yes 0 No

write a query to find 4th max salary..

Answer / nishi.swain@gmail.com

select distinct sal from table_name t1 where 4=(select count(distinct sal) from table_name t2 where
t1.sal<=t2.sal);

Is This Answer Correct ?    0 Yes 0 No

write a query to find 4th max salary..

Answer / raj

for example if we take emp table, the query like this...
select a.sal from emp a where 4=(select count(distinct(b.sal))from emp b where a.sal<=b.sal)

Is This Answer Correct ?    0 Yes 0 No

write a query to find 4th max salary..

Answer / sreeharibabu

SELECT id
FROM (select salary2.*, rownum rnum from
(select * from test ORDER BY id DESC) salary2
where rownum <=4)
WHERE rnum >= 4;

Is This Answer Correct ?    0 Yes 0 No

write a query to find 4th max salary..

Answer / mujahid

Simple one is i think:
Select min(sal) from (select sal from emp order by sal desc LIMIT 4);

Is This Answer Correct ?    0 Yes 0 No

write a query to find 4th max salary..

Answer / anand v

select user_name,sal,rank over(order by sal desc) rank from table
where rank =4

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More SQL PLSQL Interview Questions

What is offset in sql query?

0 Answers  


what are the properties and different types of sub-queries? : Sql dba

0 Answers  


Can we use update in sql function?

0 Answers  


What are the 3 modes of parameter?

0 Answers  


what are the other commands to know the structure of table using mysql commands except explain command? : Sql dba

0 Answers  


What does trigger mean in slang?

0 Answers  


Explain spool.

0 Answers  


how to enter characters as hex numbers? : Sql dba

0 Answers  


What are triggers, and when would you use them?

3 Answers  


A table has 150 records. How do you retrieve 100th row to 120th row from that table ?

21 Answers   IBM,


What are the three forms of normalization?

0 Answers  


Explain the working of foreign key?

0 Answers  


Categories