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

How many databases can sql express handle?

990


Which is faster joins or subqueries?

992


Is sql procedural language?

972


How many sectors are in a partition?

1079


What is the difference between view and stored procedure?

963


What are operators available in sql?

1051


What is the use of prepared statement?

1029


Define the select into statement.

1063


What is online transaction processing (oltp)?

1021


Can we update views in sql?

942


Is it possible to update views?

964


Explain the the delete statements in sql?

1073


What is join view in sql?

949


How do you declare a user-defined exception?

1030


What are sql procedures?

1032