On Sun, 17 Oct 1999, Andreas Gietl wrote:
> hi i'am having a little problem making mysql search for a string that
> does not completly match the searched field, but does just CONTAIN the
> search string.
> Is it possible to realize this withing Mysql or do i have to do this
> within my programm?
>
Standard SQL supports (as does MySQL) the '%' character in conjuction
with the LIKE keyword as a wildcard matching zero or more characters,
and '_' as a wildcard matching exactly one character. So:
SELECT name FROM addressbuch WHERE name LIKE '%Andreas%'
name
--------------------------
Johann Andreas Schmidt
Andreas Gietl
MySQL also supports an extension for regular expression matching.
Read all about Pattern matching in section 8.4.4.7 of the MySQL manual:
http://www.mysql.com/Manual_chapter/manual_Tutorial.html#Pattern_matching
--
Bob Kline
mailto:bkline@stripped
http://www.rksystems.com