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

Answers were Sorted based on User's Feedback



how to calcuate the second highest salary of he employee..

Answer / shailesh

select sal from emp where sal=(select max(sal) from emp
where sal<(select max(sal) from emp);

Is This Answer Correct ?    0 Yes 1 No

how to calcuate the second highest salary of he employee..

Answer / jitendra

To get nth highest Salary, use below query

SELECT TOP 1 salary
FROM (
SELECT TOP nth salary
FROM Emp
ORDER BY salary DESC
) TmpTable
ORDER BY salary ASC

Replace nth with your number like second highest=2 4th=4 etc

Is This Answer Correct ?    0 Yes 3 No

how to calcuate the second highest salary of he employee..

Answer / vivek ghorad

select min(select top(2)salary from emp)from emp;

Is This Answer Correct ?    3 Yes 9 No

Post New Answer

More SQL PLSQL Interview Questions

Are there any features that are decommissioned in 11g that are not present in 11g?

0 Answers  


Inline the values in PL/SQL, what does it mean.?

0 Answers   MCN Solutions,


in oracle 10g sw after compiling procedure how to pass parameter values ,if we (v_empid out number)how to give empid after successful compilation program.This site exact suitable for 10g with respect to question & answer same format , im trying sql browser & sql command prompt using exec procedure name & respective parameters.

0 Answers  


What is the difference between microsoft access and sql server?

0 Answers  


How to know the last executed procedure?

0 Answers  


How can the performance of a trigger be improved?

0 Answers  


What is offset in sql query?

0 Answers  


State the difference between implict and explict cursor's?

7 Answers   CTS,


Find out the 3rd highest salary?

51 Answers   BirlaSoft, DAC, Silvia Infotech, Sutra Infotech,


what is Hash join?how it is different from inner join?what is the sign used for inner join?(eg: like the (+) sign used for outer join)?

3 Answers   TCS,


When to use inner join and left join?

0 Answers  


how to run 'mysql' commands from a batch file? : Sql dba

0 Answers  


Categories