现有一张表vs_user,其中有一个字段address,值如下
我们要把"广东"改为"福建"
即如下
sql语句如下:
UPDATE vs_user
SET address = (
SELECT
*
FROM
(
SELECT
CONCAT(
'福建',
substr(
address,
POSITION('省' IN address),
CHAR_LENGTH(address)
)
)
FROM
vs_user
WHERE
POSITION('省' IN address)
) a
) WHERE
POSITION('省' IN address);