Write a query to find five highest salaries from EMP table.
(there is a column SALARY)
Answer Posted / vivek dubey
this Query is wrong : " SELECT ENAME,SALARY FROM (SELECT ENAME,SAL FROM EMP ORDER BY SALARY DESC ) WHERE ROWNUM<6; " because We can not use Order by clause in SubQuery.
This Answer gives you the right data :
"
SELECT TOP 5
empsal.ENAME,
empsal.SAL
FROM
(
SELECT ENAME,SAL
FROM EMP
) AS empsal
ORDER BY empsal.SAL DESC
"
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
is it possible to pass an object or table to a procedure as an argument?
what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba
Which are the different character-manipulation functions in sql?
Which are the different case manipulation functions in sql?
What are the types of triggers in sql?
What does sign mean sql?
How many types of literals are available in pl sql?
What is difference between mysql and postgresql?
Can we call a function containing dml statements in a select query?
What is sql*plus?
What does a pl/sql package consist of?
What do you mean by dbms? What are its different types?
Explain character-manipulation functions?
What is dense_rank in sql?
What is the need of a partition key?