【问题标题】:update the value with string replace in postgres query在 postgres 查询中用字符串替换更新值
【发布时间】:2020-12-21 09:33:15
【问题描述】:

我有表user,我想将'test user' 中的username 字段值替换为'Test User'

在所有username字段值的更新查询中

update user set username='replace()'

是否可以通过查询来完成。

【问题讨论】:

    标签: php sql postgresql


    【解决方案1】:

    使用 INITCAP

    UPDATE user
    SET username = INITCAP(username)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-09-25
      • 1970-01-01
      • 2015-04-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-02
      相关资源
      最近更新 更多