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...

select top 3 sal from each dept?

Answer Posted / santo

SELECT r.salary, r.department_id, r.RANK highest
FROM (SELECT salary, department_id,
DENSE_RANK () OVER (PARTITION BY
department_id ORDER BY salary DESC)

RANK
FROM employees) r
WHERE r.RANK <= 3
ORDER BY 2

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pl/sql language case sensitive?

1132


What is cursor status?

1193


How can I tell if sql is running?

1070


What is a memo field?

972


How do you optimize a query?

1009


How do you use collections in procedure to return the resultset?

2244


How to fetch values from testtable1 that are not in testtable2 without using not keyword?

1228


Why use stored procedures?

1098


How do you modify a table in sql?

1129


Which is faster subquery or join?

1227


How can you get sql*loader to commit only at the end of the load file? : aql loader

1021


Explain commit, rollback and savepoint.

1006


Why function is used in sql?

952


What does partition by mean in sql?

969


How much ram can sql express use?

992