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 keys and its types?

1123


Describe types of sql statements?

1107


What do you understand by pl/sql packages?

1109


Is it mandatory for the primary key to be given a value when a new record is inserted?

1254


What is the difference between execution of triggers and stored procedures?

1164


Is sql database free?

1030


Explain about various levels of constraint.

1000


What is index example?

1050


What are the different types of dbms?

1067


What is the benefit of foreign key?

1075


what is foreign key? : Sql dba

1110


What does subquery mean in sql?

1114


What are three advantages to using sql?

1074


Can we create table in function?

1023


What are tuples in sql?

1201