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 / sreenivasreddy

SELECT ROWNUM, E1.*
FROM (SELECT EName, Deptno, Sal,
DENSE_RANK()
OVER(ORDER BY Sal DESC) EmpRank
FROM Emp
GROUP BY Deptno, EName, Sal
ORDER BY EmpRank) E1
WHERE E1.EmpRank <= 5
ORDER BY ROWNUM

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the unique index?

1105


how do you control the max size of a heap table? : Sql dba

1022


how to create a new view in mysql? : Sql dba

986


What are the uses of sysdate and user keywords?

1148


explain commit and rollback in mysql : sql dba

1068


Mention what is the use of function "module procedure" in pl/sql?

1088


what are date and time data types? : Sql dba

1023


What is the sql*loader? : aql loader

1098


How many types of triggers exist in pl/sql?

1129


How does postgresql compare to mysql?

1078


What is pl sql block structure?

1086


What is a sql instance vs database?

1170


Why procedure is used in sql?

1083


What is data definition language?

1135


what are the authentication modes in sql server? How can it be changed? : Sql dba

1506