experience> novice, 68/m
MySQL> 5.5.46-0+deb7u1
Database> apparel
There are two tables> femme PRIMARY = id, colors PRIMARY = c_id
I need the following table femme to be modified (or updated ...)
id Name Fav_Colors City
1 Joe red Athens
1 Rea grey Rome
table colors must contribute it's data to table femme by replacing the above colors (flavored with some tags):
c_id Name Pref_Color City City_color
1 Joe yellow Athens blue
2 Rea green Rome black
When femme is TRUNCATE(d) at the beginning everything is ok resulting the modified femme table bellow:
TRUNCATE TABLE `femme`;
REPLACE INTO `femme`(`id`, `name`, `Fav_Colors`, `City`)
SELECT
CONCAT ('
c_id,
Name,
<div>', colors.Pref_Color, ' - ', colors.City_color,'"</div>',
City
')
from colors;
id Name Fav_Colors City
1 Joe <div>yellow - blue</div> Athens
1 Rea <div>green - black</div> Rome
I just need to do it by replacing only the Fav_Colors column, but the following is not working:
REPLACE INTO `femme`(`Fav_Colors`)
SELECT
CONCAT ('
<div>', colors.Pref_Color, ' - ', colors.City_color,'"</div>'
')
from colors;
Would you please assist to find a way to resolve this issue? Thank you.
</div>?