在PostrgreSQL中还原字符串的附加内容

问题描述 投票:0回答:1

我遵循了此问题中的步骤Append text to column data based on the column in PostgreSQL但是我在SIMILAR TO子句中犯了一个错误,文本被添加到了它不应该包含的字段中。我该如何扭转?

我运行的Te查询是:

update metadatavalue set text_value = 'Fil: ' || text_value where metadata_field_id = 136 and text_value not similar to 'Fill:%';

如何从这些字段中删除极端字符?

非常感谢。

string postgresql dspace
1个回答
0
投票
UPDATE metadatavalue SET text_value = regexp_replace(text_value, '^Fil: ','');
© www.soinside.com 2019 - 2024. All rights reserved.