Subject Re: [Firebird-Architect] IN LIST
Author Arno Brinkman
Hi,

>>> 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.
>
> IMHO, I think that he speaks about a way to 'compress' the IN members
> from the list. (But also, at the end of his message I didn't understand
> very clear what he's saying...). On my understand the query:
>
> select * from t where id in list (1, 3, 5-10, 12);
>
> will be equivalent with
>
> select * from t where id in(1, 3, 5,6,7,8,9,10, 12);

No, it will be equivalent to:

select * from t where id in(1, 3, -5, 12);

> ...personally I would prefer instead an extension of IN syntax, along to
> making the number of IN members 'unlimited' (as you know there is a
> easy, fast and safe way for this ;) ). IMHO, is very clear for the
> engine what to do when it reads in (1, 3, 5-10, 12,...) IMHO, I don't
> think that another keyword (ie. 'LIST') will help.

A <value expression> is expected inside the IN (<value expression>[, <value expression>]) this would
meant that we need to add a value-expression that represent a range.
"1-5" cannot be used, because it will calculated as +1 - +5 and thus -4, beside that the IN
predicate would be the only predicate that can handle the ranges.

Regards,
Arno Brinkman
ABVisie

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
General database development support:
http://www.databasedevelopmentforum.com

Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/

Support list for Firebird and Interbase users :
firebird-support@yahoogroups.com

Nederlandse firebird nieuwsgroep :
news://newsgroups.firebirdsql.info

--------------------------------------------------------------------------------
Mijn Postvak In wordt beschermd door SPAMfighter
1010 spam-mails zijn er tot op heden geblokkeerd.
Download de gratis SPAMfighter vandaag nog!