Subject Re: [firebird-support] Question about "IN"
Author Nando Dessena

>> L> SELECT Field1, Field2 FROM MyTable WHERE 'ConstantValue' IN Field1;
>> what does Field1 contain? A single value? A list of values? An array?
>> Please give example data and result you wish to get.

L> More than likely, VarChar(250);

erm... Did you actually reply with the requested info? :-)

If you don't tell us what you expect from the syntax above, we ain't
able to give advice nor suggest alternatives.

What does this varchar(250) column contain, then? If it's a single
value like 'foo' then you should be able to write

select *
from table
where 'foo' in (somecolumn)

but I can't see the usefulness of that. This syntax can be used for
multi-field searches, if that's what you're after:

select *
from employee
where 'Nelson' in (last_name, first_name)

but I doubt it.

On a completely different track, do you perhaps intend to search for
'constantvalue' inside the contents of Field1? If so, LIKE and
CONTAINING (the latter is case insensitive) are for you:

SELECT Field1, Field2
FROM MyTable
WHERE Field1 CONTAINING 'ConstantValue'


SELECT Field1, Field2
FROM MyTable
WHERE Field1 LIKE '%ConstantValue%'

Nando mailto:nandod@...