【发布时间】:2020-10-01 15:36:18
【问题描述】:
我在表test 中有两列,如下所示。我想使用“K”更新消息中的第二个位置,将第四个位置更新为“N”,其中id = 1 使用覆盖功能。我可以根据以下查询更新第二个位置,但无法找到第四个位置的解决方案。
您能给我一些指导吗?谢谢。
表test
id | message
------------
1 | ABCD
2 | PQRS
我写了下面的查询:
update test
set message = overlay(message placing 'K' from 2 for 1)
where id = 1
【问题讨论】:
标签: sql string postgresql sql-update overlay