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 get second highest sal of emp table

Answer Posted / anilchandu

Select * from emp x where 2=(select count(distinct sal)
from emp y where x.sal<=y.sal)


where x,y are alias names.

If you want 3rd heighest salary then just replace 2 by 3

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to drop an index in oracle?

1076


What are the advantages of oracle?

1029


Using the relations and the rules set out in the notes under each relation, write table create statements for the relations EMPLOYEE, FIRE and DESPATCH. You should aim to provide each constraint with a formal name, for example table_column_pk.

1858


What is a initialization parameter file in oracle?

1041


What is a sub query and what are the different types of subqueries?

1129


What are the common oracle dba tasks?

1154


How to run queries on external tables?

1051


How to start a specific oracle instance?

1042


How to shutdown your 10g xe server?

1152


Difference between hot backup vs. Cold backup?

999


what is partitioning? Types of partitioning. explain? what is the new kind of partitioning type introduced in 9i?

2266


How to import one table back from a dump file?

1028


What are transaction isolation levels supported by oracle?

1075


what is the difference between restoring and recovering?

1014


How to do paging with oracle?

1004