View Single Post

   
  #4 (permalink)  
Old 04-08-2008, 11:15 AM
eokumus79@gmail.com
 
Posts: n/a
Default 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


Reply With Quote