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

Is it possible to pass parameters to triggers?

1103


Is it possible for a table to have more than one foreign key?

1030


What are sql indexes?

999


Can we use pl sql in sql server?

1081


How can you save or place your msg in a table?

1001


Can we rename a column in the output of sql query?

993


Explain the uses of control file.

1050


How does join work in sql?

1012


What is coalesce in sql?

1060


How do I count records in sql?

1006


What is procedure explain with program?

1017


What are the topics in pl sql?

971


Does postgresql run on the cloud?

1147


Write the alter statement to enable all the triggers on the t.students table.

1125


Differentiate between % rowtype and type record.

1303