how to find the second highest salary from emp table?
Answer Posted / naveed saleh
You can use this for getting nth highest salary from
Employee table as follows
SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP n salary
FROM employee
ORDER BY salary DESC) a
ORDER BY salary
where n > 1 (n is always greater than one)
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How global cursor can be declare with dynamic trigger ?
Explain what is table in a database?
What is the difference between function and procedure in pl/sql?
Difference between truncate, delete and drop commands?
What is a schema sql?
What are the benefits of triggers?
Explain the working of primary key?
How do I count rows in sql query?
What is record data type?
What is database migration?
how to include numeric values in sql statements? : Sql dba
what is the difference difference between procedure and packages
Write a query to find the names of users that begin with "um" in sql?
How do I start sql from command line?
what is transaction? : Sql dba