
04-08-2008, 11:15 AM
|
| |
Re: eliminating gaps thank you very much.  you are great
Dieter Noeth wrote:
> 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 |