List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:July 3 2001 2:24am
Subject:Re: LIKE
View as plain text  
>Hi Everyone,
>Does this make sense:
>select * from table_name where column_1 LIKE "%word1% OR %word2%";

That should be:

column_1 LIKE "%word1%" OR column_1 LIKE "%word2%"

>yeilds 1 record but...
>select * from table_name where column_1 LIKE "%word2% OR %word1%";
>yields 0 records. 
>I'm scanning a VARCHAR column trying to return records that contain or
>word1 and word2. Same thing occurs when I replace OR with AND.  The
>search words appear appear in the column as:
>  word1 followed by word2. 
>Am I using the LIKE incorrectly? Does MySQL have to match the first LIKE
>operator before the second?
>Much thanks,

Paul DuBois, paul@stripped
LIKEEric Fegraus3 Jul
  • Re: LIKEDavid Robley3 Jul
  • Re: LIKEPaul DuBois3 Jul