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 do you explain an index number?
what is the functionality of the function htmlentities? : Sql dba
What is use of package in pl sql?
What is a unique key and primary key and foreign key?
Which query operators in sql is used for pattern matching?
What is the current version of sql?
what is table? : Sql dba
How do I run a program in pl sql?
What language is oracle sql developer?
What does cursor do in sql?
what are date and time data types in mysql? : Sql dba
What is data control language (dcl)?
Is left join faster than inner join?
Why do we need cursors in pl sql?
What are the disadvantages of file system?