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

What is the current version of postgresql?

1163


What is the best sql course?

1042


Can we rollback truncate?

1072


If a cursor is open, how can we find in a pl/sql block?

1235


Does group by remove duplicates?

1108


What is your daily office routine?

2340


how to use regular expression in pattern match conditions? : Sql dba

1105


Can we use distinct and group by together?

1129


what is bcp? When does it used? : Sql dba

1051


what are all the common sql function? : Sql dba

1125


what is sql server agent? : Sql dba

1173


Do we need to rebuild index after truncate?

1128


what is dbms? : Sql dba

1057


what is schema? : Sql dba

1132


what are the advantages of sql ? : Sql dba

1136