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?