List:General Discussion« Previous MessageNext Message »
From:Wm Mussatto Date:February 17 2010 5:37pm
Subject:Re: compare column value to anything in a list of values
View as plain text  
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 <contains one of>
> ('apple','orange','banana');
>
> and say value may = something like
> 'produce(grape,orange,pear,apple,lettuce)'
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>
>
IN('value1','value2') should work for exact matches, also works for
integer values.

------
William R. Mussatto
Systems Engineer
http://www.csz.com
909-920-9154

Thread
compare column value to anything in a list of valuesBryan Cantwell17 Feb
RE: compare column value to anything in a list of valuesBryan Cantwell17 Feb
Re: compare column value to anything in a list of valuesWm Mussatto17 Feb
  • RE: compare column value to anything in a list of valuesJay Blanchard17 Feb
    • Re: compare column value to anything in a list of valuesBaron Schwartz19 Feb