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

Write a query to get 2nd maximum salary in an employee table ?

Answer Posted / veera

SELECT * FROM EMP A WHERE &N-1=(SELECT COUNT(DISTINCT SAL) FROM EMP B WHERE A.SAL<B.SAL) ORDER BY SAL

Pass Paramenter :2..it will give the 2nd maximum salary

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a full join?

911


How would you reference column values before and after you have inserted and deleted triggers?

1017


what is rdbms? : Sql dba

959


Why primary key is required?

936


How do you create a db file?

957


What does select * from mean in sql?

3068


How to check if a column is nullable before setting to nullable?

1055


Can we use insert statement in function?

940


how do you login to mysql using unix shell? : Sql dba

1016


What type of database is sql?

977


How do I upgrade sql?

947


What are triggers in sql?

972


Where is sql database stored?

919


Are views faster than queries?

917


What is the size of partition table?

990