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

How do you identify a primary key?

1063


What are different types of indexes?

1010


What is foreign key in sql with example?

933


What are the benefits of triggers?

1172


What is rank dense_rank and partition in sql?

1038


what is normalization? : Sql dba

1082


Show the cursor attributes of pl/sql.

1048


Which table is left in left join?

1012


When are we going to use truncate and delete?

987


Can we change the table name in sql?

939


What are the types of operators available in sql?

1060


what are the different tables present in mysql? : Sql dba

984


How do you create an update query?

962


what is sp_pkeys? : Transact sql

1155


Is it important to partition hard disk?

1024