📜  在mysql代码示例中更新字符串的一部分

📅  最后修改于: 2022-03-11 15:05:22.687000             🧑  作者: Mango

代码示例2
SELECT Country, REPLACE(Country, 'States', 'Kingdom') 
FROM Persons;

UPDATE tableName
SET Country = REPLACE(Country, 'States', 'Kingdom')

-- if Country = 'United States'
-- After replace = 'United Kingdom'