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

An automatic job running via DBMS_JOB has failedKnowing only that its failed, how do you approach troubleshooting this issue?

2055


Can you have more than one content canvas view attached with a window ?

2333


what is the use of triggers in Java program? I mean where do we use triggers in Java programming?

2190


How to create id with auto_increment on oracle?

994


Database crashes. Corruption is found scattered among the file system neither of your doing nor of Oracles. What database recovery options are available? Database is in archive log mode.

2010


11. Display the client number and name and the client number and name of the person who referred that client.

2344


How to display row numbers with the records?

1087


what are bitmap indexes? How does they work?

2263


How to put more than 1000 values into an oracle in clause?

1035


How to create a new oracle data file?

1038


In what script is snap$ created? In what script is the scott/tiger schema created?

2715


What is the simplest tool to run commands on oracle servers?

1013


Can a formula column referred to columns in higher group ?

2510


What is null value in oracle?

1100


If any one has information regarding interview of NIC (National Informatics Centre),it would be of great help...

2234