Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: eliminating gaps
Dieter Noeth wrote:
> select
> a,
> min(b),
> max(b)
> from
> (
> select
> a - rank() over (partition by A order by b asc) as grp,
> a
> from mytab
> ) dt
> group by a, grp
> order by 1,2;
Sorry, of course it's:
select
a,
min(b),
max(b)
from
(
select
b - rank() over (partition by A order by b asc) grp, a, b
Dieter Received on Thu Aug 31 2006 - 07:32:33 CDT
![]() |
![]() |