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
from mytab
) dt
group by a, grp
order by 1,2;
Dieter |