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
What is the default isolation level in sql server? : Transact sql
What is an emotional trigger?
What is the difference between delete, truncate and drop command?
How is sql used in oracle?
What are the different types of database management systems?
How do you sort in sql?
Describe sql comments?
What does := mean in pl sql?
Write a sql query to find the names of employees that begin with ‘a’?
What has stored procedures in sql?
Why do we go for stored procedures?
Is primary key a clustered index?
what is sql profiler? : Sql dba
How much does sql cost?
How to select unique records from a table?