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
Can dml statements be used in pl/sql?
What is clustered and nonclustered index in sql?
what is offset-fetch filter in tsql? : Transact sql
What are sql functions? Describe in brief different types of sql functions?
How do I run a script in sql developer?
What is pl sql commands?
How many types of triggers are there in pl sql?
Which is the correct statement about truncate and delete?
Is full outer join same as cross join?
What are aggregate functions in sql?
List different type of expressions with the example.
What are all the different normalizations?
What is dialect in sql?
How would you reference column values before and after you have inserted and deleted triggers?
How many sql statements are used?