MySQL Forums
Forum List  »  Full-Text Search

Re: how to find particular string from text column
Posted by: Rick James
Date: May 31, 2010 11:27PM

See if this works better.
RLIKE '(^|[|])SEWER\s*:\s*Septic([|]|$)'
Remove the two "\s*" if there can never be spaces in those places.

Usually this will work correctly and run somewhat faster:
LIKE '%SEWER:Septic%';

The difference would come with
...|SEWER : Septic|... -- my RLIKE will catch it (correctly?), LIKE won't
...|SEWER:SepticTank|... -- RLIKE skips it (correctly?); my Like won't.
...|FOOSEWER:Septic|... -- RLIKE skips it (correctly?); my Like won't.

But, really, you ought to rethink this text field. Read about SETs, ENUMs. Such as
SEWER ENUM(unspecified, Septic, City, County) NOT NULL

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: how to find particular string from text column
2854
May 31, 2010 11:27PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.