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

Is sql database free?

968


What is the usage of the distinct keyword?

1215


What is full join?

949


what is a join? : Sql dba

1027


What are the two types of exceptions in pl/sql?

1047


How many triggers can be applied on a table?

930


What are stuff and replace function?

1075


What is the difference between sum and count in sql?

984


explain advantages of myisam over innodb? : Sql dba

1064


How consistent is the view of the data between and within multiple sessions, transactions or statements ?

2216


Can we debug stored procedure?

1018


What is rollback?

1110


Can we use pl sql in sql server?

1080


What is oracle sql called?

922


explain about mysql and its features. : Sql dba

1013