Re: mysql Pattern Matching
| From: | Duncan Hill | Date: | Thu, 04 Sep 2003 15:30:33 +0000 |
| Subject: | Re: mysql Pattern Matching | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-161663@lists.php.net to get a copy of this message | ||
> From: "Ralph Guzman" <ralph213@sbcglobal.net>
>
>
>> I know this question is best for the mySQL mailing list, but I am unable
>> to subscribe to their list at this moment so perhaps somebody here can
>> help me out.
>>
>> I have a table with a field where amenities are listed together using a
>> comma delimiter like: pool,spa,fitness-center
Mmm.. I'm jumping in late, and without knowledge of your app, but why not
normalise that column to its own table:
recid masterrec amenity
1 22 pool
2 22 spa
3 12 fitness-center
And run a unique key across all three columns (or drop recid and use two
columns).
select masterrec from amenities where amenity = ....
The query will still grow in length, but it may be easier to work with..
*shrug*