Databases Reference
In-Depth Information
The following screenshot shows how we ask for a search on
cinema
with the
LIKE
%...%
operator:
The
LIKE
operator can be used for other types of wildcard searches, for
example
History%
, which would search for this word at the beginning of
a title. As the expression does not start with a wildcard character, MySQL
will try to use an index if it finds one that speeds up data retrieval. For
more details about MySQL's use of indexes, please refer to
http://dev.
mysql.com/doc/refman/5.1/en/mysql-indexes.html
.
Using either of these methods of performing the query produces the following results:
The
%
and
_
wildcard characters may be repeated in a search expression; for example,
histo__
(two underscores) would match
history
whereas
histo%
would match
history
and
historian
. The MySQL manual gives more examples at
http://dev.
mysql.com/doc/refman/5.1/en/string-comparison-functions.html
.
Search WWH ::
Custom Search