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

How do I view a sql database?

1023


Can we use the cursor's to create the collection in PL/SQL?

1035


What is a stored procedure in sql with example?

1139


how to load data files into tables with 'mysqlimport'? : Sql dba

1103


What is pls_integer in pl sql?

1110


Can sql developer connect to db2?

1058


what is timestamp in mysql? : Sql dba

1085


what are the types of join and explain each? : Sql dba

1047


What is scalar function?

1059


What is the most common sql injection tool?

1050


what is a materialized view? : Sql dba

1070


What are the set operators in sql?

1083


Is it possible to Restore a Dropped Table using Rollback Command in Oracle SQL Plus ?

1234


What is the default isolation level in sql server? : Transact sql

1040


What does varchar include?

956