Mark,
It looks like you should be using full-text indexes and the match and
against functions to me.
Check out section 6.8 in the manual.
Andy
mysql query
-Original Message-
From: Mark Goodge [mailto:mark;good-stuff.co.uk]
Sent: 04 November 2002 11:21
To: [EMAIL PROTECTED]
Hi
You could use either normal or fulltext searches. Regexp may well be a good
answer (not used it myself). The following should also work
SELECT *
FROM table
WHERE
field LIKE % cat %
OR field LIKE % cat. %
OR field LIKE % cat, %
(note the spaces to make sure you get only complete words)
or if
There are too many exceptions for this to be usefull.
What about lines ending in cat. or cat,
Your example won't match them.
Perhaps % cat.% and % cat,% patterns might be more helpfull,
but what about lines that begin with cat?
Peter Lovatt wrote:
Hi
You could use either normal or fulltext
Hi,
REGEXP is much more powerful than LIKE; you can match full words
with this syntax:
SELECT *
FROM TABLE
WHERE field REGEXP [[::]]cat[[::]];
(Easy, isn't it ? ;) )
You can find more examples in the manual:
http://www.mysql.com/doc/en/Regexp.html
Regards,
Joseph Bueno
NetClub
gerald_clark