List:General Discussion« Previous MessageNext Message »
From:Bob Kline Date:October 17 1999 5:58pm
Subject:Re: text search with mysql
View as plain text  
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

Thread
text search with mysqlAndreas Gietl17 Oct
  • Re: text search with mysqlAndrian17 Oct
  • Re: text search with mysqlBob Kline17 Oct
  • Re: text search with mysqlTkil17 Oct
  • Re: text search with mysqlJim Faucette18 Oct
  • Re: text search with mysqlx x xu19 Oct