I have a MYSQL table called shoptable. This table contains an article number in the column/field named sku. I have an empty column/field called imgurl, which I would like a single query to populate for all rows.
I would like to concat a static string, containing the URL and the article number (sku) being the long tail path and UPDATE it into the imageurl field.
This query is out of my league.
To explain what I am trying to achieve, here a laymens attempt of writing it:
UPDATE shoptable AS s
SET @IMGPATH = s.sku
SET @URL = CONCAT("websitedomain.com/", IMGPATH)
SET s.imageurl = URL
I am using double quotes as the query is called from inside NODE JS and is embedded in single quotes. I could change that around if needed.
You can use the following Query:
UPDATE shoptable SET imageurl = CONCAT("websitedomain.com/", sku);