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 out the second highest salary?

Answer Posted / priyankur

@peter: your query is pretty cool but it wont work when
there are multiple salaries with same amount. I mean three
persons have same salary 24000, which is MAX sal in salary
table. In that case, below query will work.

select a.salary from employees a where 1 = (select count
(distinct b.salary) from employees b where
a.salary<b.salary)

Digit 1 is (n-1) where n is nth value. Here n is 2(Second
highest salary).

I would appreciate if anybody tried to break my above query
and explain how does this work.

Is This Answer Correct ?    7 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many objectname will be created for a single table drop function? Why 'flashback' query giving error "ORA-38312: original name is used by an existing object" while getting the table?

2205


Why do we need integrity constraints in a database?

975


What is coalesce function?

1013


what's query optimization and without use of IN AND Exist can we get another way data from query

2091


List out the types of joins.

1083


Can we save images in a database and if yes, how?

1003


How to get last row id?

941


List the types of joins used in writing subqueries?

945


How can we force the database to use the user specified rollback segment?

1071


Briefly explain what is literal? Give an example where it can be used?

976


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

2278


how may join possible between (requisition with purchase order)

2170


Can you tell me how to add new column in existing views?how?How is possible?

1373


How to view the data files in the current database?

1045


Explain the use of indexes option in imp command.

1089