Write a query to find second highest salary of an employee.
Answer Posted / gautam poonia
SELECT sal
FROM (SELECT sal FROM emp
ORDER BY sal desc)
WHERE RowNum<=2
minus
SELECT sal
FROM (SELECT sal FROM emp
ORDER BY sal desc)
WHERE RowNum<=1
| Is This Answer Correct ? | 17 Yes | 1 No |
Post New Answer View All Answers
what are the differences between binary and varbinary? : Sql dba
What is query execution plan in sql?
What is auto increment in sql?
What is transaction control language (tcl)?
What are the different set operators available in sql?
Show the two pl/sql cursor exceptions.
How many sql statements are used? Define them.
how can I make a script that can be bi-language (supports english, german)? : Sql dba
What are the set operators in sql?
Is sql port 1433 encrypted?
How do you sort in sql?
how to convert character strings to dates? : Sql dba
Is subquery faster than join?
What is a relationship and what are they?
What is difference between nchar and nvarchar?