Subject | Re: [Firebird-Architect] IN LIST |
---|---|
Author | Adriano dos Santos Fernandes |
Post date | 2006-12-03T13:12Z |
Dmitry Yemanov wrote:
w is the list, x is the items separator, y the range separator and z an
escape.
Adriano
> Adriano dos Santos Fernandes wrote:A list of ranges and items.
>
>> Hence, a way to pass indeterminate number of intervals is very great:
>> select * from t where id in list '5-10,20-30,50'
>>
>
> Do we speak about lists or ranges or both? IMO, the syntax should be
> clear about that.
>
>The complete syntax may be: IN LIST w [DELIMITED BY x [AND y]] [ESCAPE z]
>> And I see this syntax as a complement to FB2.1 LIST aggregate function,
>> i.e. result of LIST can be passed to IN LIST. Example:
>> select list(id) from t into :ids;
>> for select * from t where id in list :ids ...
>>
>
> 1) What will be a complement for:
> select list(id, '$') from t into :ids
> ?
>
w is the list, x is the items separator, y the range separator and z an
escape.
> 2) Why is it better than a simple:This requires inserting in a temp table and don't work for ranges.
>
> for
> select * from t
> where id in ( select ... )
> ?
>
> I.e. why would you need an intermediate step?
>
Adriano