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

why sql is used as interpreter frequently rather than a compile?

1 Answers  


How write primary and foreign key relationship between two tables without using constraints? u can use any of procedure/function/trigger and any sql?

1 Answers   Parexel,


What is difference between pls_integer and integer?

0 Answers  


What is difference between my sql and sql?

0 Answers  


How to trace the errors in pl/sql block code?

5 Answers   TCS,


Is sqlite good enough for production?

0 Answers  


What is meant by Materialized view?

2 Answers   iGate, Marlabs, Polaris,


How do I clear the screen in sql plus?

0 Answers  


What is varchar sql?

0 Answers  


What is a CTE (Common Table Expression), and how is it different from a subquery?

3 Answers  


Which column of the user triggers data dictionary view displays the database event that will fire the trigger?

0 Answers  


What is crud stand for?

0 Answers  


Categories