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
[EMAIL PROTECTED]
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php