On Sat, 29 Mar 2003 05:43:53 -0500, Jeff Moore wrote: >However, this query does not work correctly If you generalize is to >include a database column: > >SELECT * FROM MyTable WHERE 'haystack needle haystack' LIKE CONCAT('%', >NeedleColumn, '%')
Two things: 1. you don't seem to need the CONCAT() function. Just stick the % signs around the string you're looking for. 2. your syntax just seems wrong. This should be: SELECT * FROM MyTable WHERE NeedleColumn LIKE '%needle%'; to search for the string 'needle' anywhere in NeedleColumn, if that's what you were looking for. I'm jumping in mid-stream so excuse me if I'm confused. -- Trevor Smith | [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]