replacing value of a column(unknown length) with substring
How can I replace the value(unknown length) of a column in mySQL workbench with a substring that exists in that column?
For ex:
If I have the value of a column like "ABC.123.Chrome/123", how do I replace this for all rows with just "Chrome/123"? I want to replace value in that string of unknown length with everything that comes after C开发者_运维知识库hrome only.This should work if you want to include Chrome:
UPDATE MyTable
SET ColumnName = SUBSTRING(ColumnName,LOCATE('Chrome'))
WHERE ColumnName LIKE '%Chrome%'
精彩评论