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 third highest salary?

Answer Posted / meher

SELECT SAL FROM EMP A WHERE &N= (SELECT COUNT(DISTINCT) SAL
FROM EMP B WHERE A.SAL<B.SAL)

--Pass the value for N as 2 to get 3rd highest salary.
--pass 0 for highest sal,1 for 2nd highest,2 for 3rd
highest and so on....

Is This Answer Correct ?    6 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When do we use triggers?

1084


What is rename in sql?

978


What is dbo in sql?

973


What is set serveroutput on?

1139


The in operator may be used if you know the exact value you want to return for at least one of the columns.

1136


what is self-join? : Sql dba

1169


How do I trace sql profiler?

987


What is the difference between left outer join and left join?

997


What are the different dcl commands in sql?

1177


what are all the common sql function? : Sql dba

1061


How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?

1136


what are the authentication modes in sql server? : Sql dba

1067


How do you optimize a query?

1008


What are the two different parts of the pl/sql packages?

1090


What are the different types of tables in sql?

1009