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
Can we use rowid as primary key?
What is crud sql?
what is cursor and its type, what is ref cursor write a syntax to pass ref cursor into procedure out fucntion and call the procedure
How delete a row in sql?
Explain the order of sql statement execution?
What is the difference between an inner and outer join?
how can we transpose a table using sql (changing rows to column or vice-versa) ? : Sql dba
How many types of relationship are there?
When sql appeared?
what are local and global variables and their differences? : Sql dba
what is the syntax for using sql_variant_property? : Transact sql
How do I send sql query results to excel?
What action do you have to perform before retrieving data from the next result set of a stored procedure ?
Why sql query is slow?
What is partition by in sql?