> [snip]
> Is there a simple function or method to compare a value in a column to
> one or more items in a comma separated list?
> [/snip]
Take a look at SUBSTRING_INDEX and related string functions.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
[snip]
IN('value1','value2') should work for exact matches, also works for
integer values.
[/snip]
IN will not open and read his CSV file...
[snip]
Is there a simple function or method to compare a value in a column to
one or more items in a comma separated list?
[/snip]
In order to do this you
On Wed, February 17, 2010 09:24, Cantwell, Bryan wrote:
> Is there a simple function or method to compare a value in a column to one
> or more items in a comma separated list?
>
> select * from table where value
> ('apple','orange','banana');
>
> and say value may = something like
> 'produce(grape
..@optonline.net [dryd...@optonline.net]
Sent: Wednesday, February 17, 2010 11:31 AM
To: Cantwell, Bryan
Subject: Re: compare column value to anything in a list of values
yes, there is... IN
SELECT * FROM tbl WHERE col IN ("v1", "v2", "v3")
- Original Messag