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

What is system global area (sga) in oracle?

968


I just want to maintain data like an employee can belongs to 3 or more departments . We can resolve this by using composite key but it avoids normalization rules. So Can anyone tell me how can I maintain data.

2170


What is a trigger oracle?

1072


Using the relations and the rules set out in the notes under each relation, write statements to create the two sequence generators specified in the notes.

2090


Select all the employees who were hired in last 2 years and who works in dept where max managers are working.

2944


Differentiate between translate and replace?

1083


What are the arithmetic operations?

1064


How to use regular expression in pattern match conditions in oracle?

1018


What is an oracle user role?

967


What is parameterized cursor in oracle?

1115


How to export data to a csv file?

1273


does the query needs a hint to access a materialized view?

1844


Name the three major set of files on disk that compose a database in Oracle?

1103


What happens if recursive calls get out of control?

1060


How to update values in a table in oracle?

1001