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

What is structural independence and why is it important?

978


How do you update f as m and m as f from the below table testtable?

1789


is it possible to pass an object or table to a procedure as an argument?

1058


What is the difference between the implicit and explicit cursors?

992


Mention what are different methods to trace the pl/sql code?

1102


What is the difference between numeric and autonumber?

939


What is auto increment in sql?

1060


Define overloaded procedure?

1013


Can we connect to postgresql using sql developer?

934


Why is pl sql used?

937


What is a database? Explain

1050


Is ms sql is free?

955


What are the types of records?

951


What is consistency?

1060


What are the events on which a database trigger can be based?

1100