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

What is dcl in sql?

965


Explain the uses of control file.

1050


What is trigger explain it?

1019


what are all the different normalizations? : Sql dba

1047


What are sql objects?

1082


What does closing a cursor do?

1327


What do you understand by pl/sql packages?

1061


what are ddl statements in mysql? : Sql dba

1203


explain the delete statements in sql

1064


What is the source code of a program?

1074


Why select is used in sql?

1023


How run sql*plus commands that are stored in a local file?

1062


what is sql profiler? : Sql dba

1050


How many types of functions are there in sql?

955


What is vector point function?

1056