cabul
09-25-2001, 11:32 AM
Does anyone know how I would go about taking a table that consists of 2 fields (Item, Keywords) and removing the duplicate keywords. For instance, for an item "Ultraviolet Systems" it has a keyword list "Filter system, water filter, sediment, etc." and I would like it to show "filter" only once... Thanks.
Atomic Shrimp
09-27-2001, 02:43 AM
I can only suggest a method (I'm afraid I don't have the time to put together a complete solutions for you).
In the long run, your keywords might be best stored in a separate table with one keyword per row, like this:
ItemID(Foreign key), Keyword
1,Filter
1,System
1,Water
1,Sediment
2,Gravel
2,Suction
2,Clean
3,Heater
4,Pump
4,Circulation
and so on (each row is tied to the item by the foreign key value)
Searching for duplicates in keywords thus organised is a piece of cake.
To get there from where you are now, you'll need a bit of code that splits each keyword in a row (stripping it of punctuation and spaces) and appends it to a row of it's own in the keywords table (including the foreign key value at the same time)
Hope this is some kind of help...
Mike