By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,190 Members | 2,204 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,190 IT Pros & Developers. It's quick & easy.

top 5 ( or n) salaries in each department

P: n/a
Niy
how to get that with SQL query?
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Read the "Functions" chapter of the Oracle SQL Reference for "analytic
functions".

In Oracle 8i or higher you should write SQL like following:

select * from (
select DepName, Salary, row_number() over (partition by DepName order by
Salary desc) RK from SALARYTABLE
) where RK<=5

"Niy" <ni***@hotmail.com> wrote in message
news:55**************************@posting.google.c om...
how to get that with SQL query?

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.