On Sun, 8 Apr 2001, John Hart wrote:
> I am working on a rather large database project, in which I am making a text column
>that contains different data, seperated by commas. What I need to do is run a query
>where I will return only the datasets that contain any of sets that partially, or
>fully match any data in the set...
>
> For example, if the dataset contains:
>
> dark, black, small
>
> I want to be able to return this data if the query contains ran contains any of the
>following matches:
>
> dark
> black
> small
> sma
> bla
> ...etc...
>
> I do not, however, want a full LIKE search with wildcards, because I do not want to
>return the set if they were to search on 'all' (which would match smALL).
>
> Is there an easy way to do this, or am I forced into matching entire words in a set?
>
> I appreciate any help anyone could offer me... Thank you...
>
> John
>
If I got you correctly, you might consider RLIKE where you define the mathing string
as a regular expressions. So in you case the regexp would be something like:
RLIKE ".*, YOUR_QUERY_STRING_HERE.*, .*"
regards,
thalis
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php