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 do I send sql query results to excel?

1110


what is the difference between join and union? : Sql dba

1195


What are the types pl/sql code blocks?

1192


What is sql table?

1020


Is mariadb a nosql database?

1098


What are all different types of collation sensitivity?

1075


What does varchar include?

991


How do I kill a query in postgresql?

1182


What is rowtype?

1079


what are string data types? : Sql dba

1092


Explain the difference between triggers and constraints?

1023


What are packages in pl sql and also explain its advantages?

1120


What version is sql?

1076


how many columns can be used for creating index? : Sql dba

985


Which join is default?

1012