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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I count duplicates in sql?

1116


What is crud stand for?

1003


what is rdbms? : Sql dba

1018


What are different categories of sql commands?

1135


How many sql statements are used? Define them.

1044


what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba

986


Explain alias in sql?

1053


What is varchar data type in sql?

1088


What are the triggers associated with image items?

1042


what is oltp (online transaction processing)? : Sql dba

1082


How exception handling is done in advance pl/sql?

985


How do I install sql?

1002


What is the basic structure of an sql?

1107


How global cursor can be declare with dynamic trigger ?

2215


What are the advantages of pl sql over sql?

1027