From: Wm Mussatto Date: February 17 2010 5:37pm Subject: Re: compare column value to anything in a list of values List-Archive: http://lists.mysql.com/mysql/220731 Message-Id: <5ea0115b497f071892c3492f13d9704f.squirrel@secure2.csz.com> MIME-Version: 1.0 Content-Type: text/plain;charset=UTF-8 Content-Transfer-Encoding: 8bit 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,orange,pear,apple,lettuce)' > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql?unsub=mussatto@stripped > > 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