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 are the difference between clustered and a non-clustered index? : Sql dba

1034


What is a data definition language?

1144


What is mdb stand for?

1015


How to disable a trigger name update_salary?

1269


When is the explicit cursor used ?

1038


What are sql functions? Describe the different types of sql functions?

1147


What is the difference between delete, truncate and drop command?

1157


what is error ora-03113: end-of-file on communication channel?

1168


what are all the different types of indexes? : Sql dba

1051


What is sql performance tuning?

927


what is the difference between truncate and delete statement? : Transact sql

1073


what is user defined functions? : Sql dba

1038


Which are the different types of indexes in sql?

1064


Where is sql database stored?

988


explain access control lists. : Sql dba

1005