Subject Re: [firebird-support] Re: SQL Help
Author Steve Wiser
I don't know if this query works or is efficient at all, but maybe try
something like:

select distinct d1.Word_No
from DownLoad d1
join DownLoad d2 on d1.Used = d2.Used
where ( abs( d1.Word_No - d2.Word_No ) = 1 ) AND
( d1.Used = 'F' )
order by d1.Word_No

-steve

jackmills75 wrote:
>
> --- In firebird-support@yahoogroups.com
> <mailto:firebird-support%40yahoogroups.com>, "Svend Meyland Nicolaisen"
> <news@...> wrote:
> >
> > Eh, is this what you want?
> >
> > Select first 6 Word_No
> > from DownLoad
> > Where Used = 'F'
> > Order By Word_No
> >
> > /Svend
> > ________________________________
> Hi Svend
>
> Thanks for the response.
> Not quite, I need a group of "Word_No"'s that are cconsecutive
> e.g.
> All these are Used = 'F'
> 3, 4, 11,12,13,14,15,16,17,23,24,25
> I want the query to return 11,12,13,14,15,16
>
> Regards
>
> Jack
>
>