1

I have a database for my eCommerce site, I am looking to remove the a the category out of the products field. I can do it manually using:

UPDATE  `master_database`.`products` 
SET  `product_name` =  'Xperia Z' 
WHERE  `products`.`product_id` =5107;

So I've removed the word "Sony" out like this but how would I remove "Sony" out of all of the rows that have them in the products table?

1 Answer 1

1

You could use replace:

UPDATE `master_database.products` 
SET    `product_name` = REPLACE (`product_name`, 'Sony ', '')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.