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
What is dcl in sql?
Explain the uses of control file.
What is trigger explain it?
what are all the different normalizations? : Sql dba
What are sql objects?
What does closing a cursor do?
What do you understand by pl/sql packages?
what are ddl statements in mysql? : Sql dba
explain the delete statements in sql
What is the source code of a program?
Why select is used in sql?
How run sql*plus commands that are stored in a local file?
what is sql profiler? : Sql dba
How many types of functions are there in sql?
What is vector point function?