Question

This is my table that I have. I want to Insert comma separated values from tag_title column to tagList column matching the fk_ContentDataID which is unique. Can I do it on MySQL or do I need a PHP Script for this.

**fk_contentDataID             fk_tagID       tag_title                  tagList**
68                                 789          ANGELINA JOLIE              NULL
1325                               789          ANGELINA JOLIE              NULL  
1986                               789          ANGELINA JOLIE              NULL  
2052                               789          ANGELINA JOLIE              NULL  
2145                               789          ANGELINA JOLIE              NULL  
Was it helpful?

Solution

UPDATE Table SET tagList = REPLACE(tag_title,' ',',');

Hope this is what you were looking for

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top