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
What is thread join () in threading?
how to fetch alternate records from a table? : Sql dba
What are pl sql data types?
Why we use pl sql?
How do I run a sql trace?
How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?
What are the types of sql commands?
what are the differences between require and include, include_once and require_once? : Sql dba
Can a foreign key be a duplicate?
How to run pl/sql statements in sql*plus?
Do ddl statements need commit?
What is sql injection vulnerability?
Explain how exception handling is done in advance pl/sql?
How to display Row Number with Records in Oracle SQL Plus?
What are the types of keys?