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...

find the second highest salary of the emp table

Answer Posted / ramesh mopuri

okay above queries are fine
but in a table there are 99 salaries, so i want to pick the
50th highest salary is it possible to wright the query same
above for the get 50th high salary. absolutely not. see my
query for the get Nth salary in a table.

Select ename,sal,deptno from emp a
where &n=
(select count(distinct(sal))from emp b
where a.sal<=b.sal)
order by deptno;

after enter this query the system ask N value and give 50
the result will be shown 50th highest salary. Please reply
me whether its working or not.

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to convert characters to numbers in oracle?

1115


How do I connect to oracle database?

1203


What is recycle bin in Oracle?

1200


What is recovery manager in Oracle?

1115


How index is implemented in oracle database?

1049


definition of cluster and non-clustered index?

3112


How to sort output in descending order in oracle?

1107


How to retrieve data from an explicit cursor?

1111


How to drop an index?

1015


How do I spool to a csv formatted file using sqlplus?

1092


What is the recommended interval at which to run statspack snapshots, and why?

2967


What is the difference between $oracle_base and $oracle_home?

1140


What does sharding mean?

1057


what are the default admin accounts in Oracle 10g ?

1024


What is an oracle and why it is used?

1218