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

how to calcuate the second highest salary of he employee

Answer Posted / ramya p

SELECT DISTINCT (sal),deptno FROM emp a
WHERE &N = (SELECT COUNT (DISTINCT (b.sal)) FROM emp b
WHERE a.sal<=b.sal)

N is the Nth highest salary you want to print. In this case
N=2

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why use truncate instead of delete?

1074


What are secondary keys?

1041


What is sqlca in db2?

1046


What packages(if any) has oracle provided for use by developers?

5896


how is myisam table stored? : Sql dba

1099


What is secondary key?

998


what is view? : Sql dba

1029


What is mutating error in pl sql?

1075


What is sql query optimization?

1205


What is assignment operator in pl sql?

1094


Any attempt to navigate programmatically to disabled form in a call_form stack is allowed?

1153


How do you concatenate in sql?

1088


If the application is running very slow? At what points you need to go about the database in order to improve the performance?

1057


What is the difference between execution of triggers and stored procedures?

1171


what is innodb? : Sql dba

1182