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 can we avoid duplicating records in a query?
What is sql partition?
Where not exists in sql?
Does mysql_real_escape_string prevent sql injection?
How do you copy a table in sql?
Which column in the user.triggers data dictionary view shows that the trigger is a pl/sql trigger?
How do you write a complex sql query?
Why commit is not used in triggers?
Can I learn sql in a week?
What is normalization sql?
Explain the structure of pl/sql in brief.
What is normalisation in sql?
What are different clauses used in sql?
What is schema in sql?
How do I view output in sql developer?