Answer the question
In order to leave comments, you need to log in
How to replace part of text in Sql table with query?
In the product table there is a description field in which you need to delete all "(MMLDS / RU)" models in brackets are always different. Delete along with parentheses.
Tried like this, but nothing comes out. If you explicitly specify the replacement string, then it works.
UPDATE product SET `description` = REPLACE( `description` , like'%(%)%', '' )
Answer the question
In order to leave comments, you need to log in
UPDATE `product`
SET `description` = CONCAT(SUBSTRING_INDEX(`description`, '(', 1), SUBSTRING_INDEX(`description`, ')', -1))
WHERE `description` LIKE '%(%)%'
UPDATE product SET `description` =
CONCAT( SUBSTR(`description`, 1, INSRT(`description`, '(')-1),
SUBSTR(`description`, INSRT(`description`,')')+1) )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question