From: Dan Nelson Date: January 29 2002 8:27pm Subject: Re: Please Help with Pattern Matching List-Archive: http://lists.mysql.com/mysql/97895 Message-Id: <20020129202703.GF92289@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In the last episode (Jan 29), Douglas Brantz said: > I have a big problem with pattern matching; > Why does the first example work like this I need to find everything with > MWF in it and I only get the 1 entry? Is there a way I can make this > work. > > mysql> select schdays from courses where schdays LIKE "%MWF%"; > | MWF | > > mysql> select schdays from courses where schdays LIKE "%M%"; > | MWF | > | MW | > | MW | > | M | > | M | I see nothing wrong here. Your first statement says "give me all rows with the string MWF in schdays". Your second statement says "give me all rows with the string M in schdays". If you want all rows with M, W, or F in schdays, you'll want something like WHERE schdays LIKE "%M%" OR schdays LIKE "%W%" OR schdays LIKE "%F%". -- Dan Nelson dnelson@stripped