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
How do you identify a primary key?
What are different types of indexes?
What is foreign key in sql with example?
What are the benefits of triggers?
What is rank dense_rank and partition in sql?
what is normalization? : Sql dba
Show the cursor attributes of pl/sql.
Which table is left in left join?
When are we going to use truncate and delete?
Can we change the table name in sql?
What are the types of operators available in sql?
what are the different tables present in mysql? : Sql dba
How do you create an update query?
what is sp_pkeys? : Transact sql
Is it important to partition hard disk?