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 $$ in sql?
Does mysql support pl sql?
What is audit logout in sql profiler?
What is Materialized View? In What Scenario we Use Materialized View?
what are the differences between char and varchar? : Sql dba
What is the most common sql injection tool?
write an sql query to find names of employee start with 'a'? : Sql dba
How do you take the union of two tables in sql?
what is a join? : Sql dba
What is a primary key sql?
name 3 ways to get an accurate count of the number of records in a table? : Sql dba
what is the difference between a local and a global temporary table? : Sql dba
What is procedure function?
What is cte sql?
What can you do with pl sql?