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

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.