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

Why do we use %rowtype & %type in plsql?

1099


What is execution plan in sql?

1092


Why select is used in sql?

1070


Should I use mbr or gpt?

1062


What is %s in sql?

1078


What are sql commands?

1067


Can we update views in sql?

989


How do you optimize a stored procedure query?

1043


what are the authentication modes in sql server? How can it be changed? : Sql dba

1511


What is row_number () in sql?

1024


What are tables and fields?

1087


Is keyword pl sql?

1057


What do you understand by pl/sql cursors?

1148


What does joining a thread mean?

1077


What do you know by pl/sql cursors?

1170