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 count records in sql?

977


How to display the records between two range in Oracle SQL Plus?

1131


Does oracle roll back the transaction on an error?

1000


What is a boolean in sql?

965


What is pivot in sql?

901


What is difference between left and right outer join?

966


How do you drop a trigger?

967


Why do we need cursors in pl sql?

1059


how many sql dml commands are supported by 'mysql'? : Sql dba

1097


Why truncate is used in sql?

982


What is the importance of sqlcode and sqlerrm?

1329


What are sql objects?

1063


Is sql better than excel?

1117


What is pivot query?

1055


What is exit statement?

999