Re: top 5 ( or n) salaries in each department
From: Dmitry E. Loginov <lde_at_mpsb.ru>
Date: Fri, 21 May 2004 10:12:36 +0400
Message-ID: <c8k6kj$1ecd$1_at_news.caravan.ru>
Date: Fri, 21 May 2004 10:12:36 +0400
Message-ID: <c8k6kj$1ecd$1_at_news.caravan.ru>
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 - 08:12:36 CEST