Subject Re: [firebird-support] Re: IN function
Author Dmitry Yemanov
yartax1 wrote:
>
>> select * from table
>> where ',' || :mylist || ',' containing ',' || field_integer || ','
>
> This expression is a bit difficult to me. If I process the string, it
> result like "where ,'123,345,342',containing, field_value" ?!?!. But
> it runs semi-OK for me. Containing operator not perform an exact
> match. Values 1 and 12 and 123 are match for search value 123.

Nope. You used commas as separator values and I just followed your
convention. My example would be easier to understand with another
separator character, e.g.:

:mylist = '~123~345~342~';
select * from T where :mylist containing '~' || field_integer || '~'

so '~123~345~342~' is evaluated against values of '~1~', '~12~', '~123~'
and only the latest one will give you a match.


Dmitry