jeudi 15 janvier 2015

Removing Duplicated Substrings

I understand that the following question may not be best practice.


I have a table that has the following structure, the keyword column and title column concat into the mashup column.



+------------+------------+-----------------------+
| Keyword | Title | Mashup |
+------------+------------+-----------------------+
| Green | Green | Green Green |
| Green | Watermelon | Green Watermelon |
| Watermelon | Watermelon | Watermelon Watermelon |
+------------+------------+-----------------------+

I would like to know if there is a way of "deduping" the string. So my table will look more like the below:



+------------+------------+-----------------------+
| Keyword | Title | Mashup |
+------------+------------+-----------------------+
| Green | Green | Green |
| Green | Watermelon | Green Watermelon |
| Watermelon | Watermelon | Watermelon |
+------------+------------+-----------------------+

Is this possible? I can't seem to find a solution. Thanks!


Aucun commentaire:

Enregistrer un commentaire