how to calcuate the second highest salary of he employee
Answer Posted / 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 |
Post New Answer View All Answers
How to generate a salary slip like jan 1000 1000 feb 1000 2000 ... dec 1000 12000
How do you modify a trigger?
How is data stored in sql?
Can cursors be part of a trigger body?
Is grant a ddl statement?
how to get a list of columns in an existing table? : Sql dba
What is sql and how does it work?
What is the purpose of cursors in pl/sql?
What is count * in sql?
What is nvarchar max in sql?
What is the purpose of my sql?
What is meaning of <> in sql?
What is the difference between the conventional and direct path loader? : aql loader
how to calculate the difference between two dates? : Sql dba
how can we destroy the cookie? : Sql dba