List:General Discussion« Previous MessageNext Message »
From:Douglas Brantz Date:January 29 2002 8:44pm
Subject:Pattern Matching Solved
View as plain text  
Paul Dubois helped me on this: Check page 520 of his book.

REGEXP "[MWF]"  matches all I need everything inside the [...]
(brackets).

Thank you again Paul.

That problem fixed now moving on to the next one.

Douglas

--
Douglas R. Brantz
Computer Consultant
Fine & Applied Arts
Appalachian State University
Boone, NC 28608

828-262-6549 (office)
828-262-6312 (fax)


-----Original Message-----
From: Gurhan Ozen [mailto:c-gurhan.ozen@stripped] 
Sent: Tuesday, January 29, 2002 3:24 PM
To: Douglas Brantz; mysql@stripped
Subject: RE: Please Help with Pattern Matching

Doug,
MySql is doing what it is supposed to... If you specify '%MWF%' it will
only
select the values with the string literal 'MWF' in it. If you would like
to
match all the rows that have either M or W or F in it, then use a query
like
:
  select schdays from courses where schdays LIKE "%M%" OR LIKE "%W%" OR
LIKE
"%F%";
  This will return every row that has either M or W or F in the schdays
field.

Gurhan


-----Original Message-----
From: Douglas Brantz [mailto:brantzdr@stripped]
Sent: Tuesday, January 29, 2002 2:59 PM
To: mysql@stripped
Subject: Please Help with Pattern Matching


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%";
+---------+
| schdays |
+---------+
| MWF     |
+---------+
1 row in set (0.00 sec)

mysql> select schdays from courses where schdays LIKE "%M%";
+---------+
| schdays |
+---------+
| MWF     |
| MW      |
| MW      |
| M       |
| M       |
+---------+
5 rows in set (0.00 sec)

Thanks in advance,
Douglas

--
Douglas R. Brantz
Computer Consultant
Fine & Applied Arts
Appalachian State University
Boone, NC 28608

828-262-6549 (office)
828-262-6312 (fax)




---------------------------------------------------------------------
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 <mysql-thread97888@stripped>
To unsubscribe, e-mail
<mysql-unsubscribe-c-gurhan.ozen=wcom.com@stripped>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
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 <mysql-thread97894@stripped>
To unsubscribe, e-mail
<mysql-unsubscribe-brantzdr=appstate.edu@stripped>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Thread
Please Help with Pattern MatchingDouglas Brantz29 Jan
  • Re: Please Help with Pattern MatchingPaul DuBois29 Jan
  • RE: Please Help with Pattern MatchingGurhan Ozen29 Jan
    • Pattern Matching SolvedDouglas Brantz29 Jan
  • Re: Please Help with Pattern MatchingDan Nelson29 Jan
RE: Please Help with Pattern MatchingRoger Karnouk29 Jan