how to find the second highest salary from emp table?
Answer Posted / ravi
SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP n salary
FROM employee
ORDER BY salary DESC) a
ORDER BY salary
where n is the nth highest salary
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Can we use join in subquery?
What are aggregate and scalar functions?
What are the advantages of indexing?
what is the difference between sql and t-sql? : Transact sql
What is the difference between the implicit and explicit cursors?
What is a full join sql?
Does view store data in sql?
Define union, minus, union all, intersect ?
explain what is mysql? : Sql dba
what are date and time data types in mysql? : Sql dba
How many types of cursors supported in pl/sql?
What is Histogram?
Can you load data into multiple tables at once? : aql loader
Is sql similar to python?
How do you delete a table?