I have a huge table of products from a specific vendor with a UPC column. I need to differentiate these products' UPCs from other vendors. The current idea is to prepend all of these UPCs with the letter a
.
UPDATE abc_items SET upc = 'a' + upc
is basically how I imagine doing something like this, but I know it will not work.
To add/ concatenate text values within a select clause, you can use concat() function.
Just use the CONCAT function.
CONCAT(str1,str2,...)
Returns the string that results from concatenating the arguments. May have one or more arguments. If all arguments are nonbinary strings, the result is a nonbinary string. If the arguments include any binary strings, the result is a binary string. A numeric argument is converted to its equivalent nonbinary string form.
UPDATE abc_items SET upc = CONCAT('k', upc)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With