Jigal van Hemert wrote:
From: "Paul Groves"
SELECT * FROM object WHERE description REGEXP '[[:<:]]elbow[[:>:]]';
There are records in the object table that have the following description fields (as test data):
elbows ligaments elbowed ligaments My elbow elbow joint Whose elbow is that
The query should, as far as I can tell from http://dev.mysql.com/doc/mysql/en/regexp.html, be returning the last three records, but is returning nothing... any ideas? Thanks
First try: SELECT 'My elbow' REGEXP '[[:<:]]elbow[[:>:]]'; and SELECT 'elbowed ligaments' REGEXP '[[:<:]]elbow[[:>:]]'; to see whether the regular expression are working correctly.
Yes, these both work fine... which makes me think there is something wrong with my syntax for my query, but I don't know what...
Er... correction, it seems to work okay now, not sure what I was doing wrong before, sorry!
BTW is there anyway to speed up the search, as I think this may be pretty slow (there will be about 25000 records in the real database...) e.g. maybe by doing a LIKE match for "%elbow%" first then doing a REGEXP within that? Not sure how one would code the SQL for that, though...
regards
Paul
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]