Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在更新/替换时遇到问题。
这是我正在尝试处理的现场数据:
--- - "true" - "false" - "true"
这是查询:
UPDATE table SET field = replace (field, '--- \r\n- ', '')
它需要结束为:
"true" - "false" - "true"
我添加了一些 WHERE 标准,但它一直说 0 行受到影响。我会错过什么?
这对我有用:
create table yourtable (field varchar(100)); insert into yourtable values ('--- - "true" - "false" - "true"'); update yourtable set field = replace(field, '--- \n- ', '');
http://sqlfiddle.com/#!2/2959f/1