Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

is it possible to pass an object or table to a procedure as an argument?

1062


what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba

910


Which are the different character-manipulation functions in sql?

990


Which are the different case manipulation functions in sql?

955


What are the types of triggers in sql?

1018


What does sign mean sql?

1022


How many types of literals are available in pl sql?

1047


What is difference between mysql and postgresql?

1046


Can we call a function containing dml statements in a select query?

920


What is sql*plus?

1019


What does a pl/sql package consist of?

931


What do you mean by dbms? What are its different types?

952


Explain character-manipulation functions?

1070


What is dense_rank in sql?

917


What is the need of a partition key?

942