| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.oracle -> Re: top 5 ( or n) salaries in each department
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" <niy38_at_hotmail.com> wrote in message
news:55dd405a.0405202107.79a203ed_at_posting.google.com...
> how to get that with SQL query?
Received on Fri May 21 2004 - 01:12:36 CDT
![]() |
![]() |