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  
Était-ce utile?

La solution

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

Hope this is what you were looking for

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top