1. 首页
  2. 数据库运维
  3. PostgreSQL

PostgreSQL字符串追加和替换SQL

字符串追加

查询

select 'a' || name as name, 'b' || age as age from mytable;

更新

update mytable set name = 'a' || name, age = 'b' || age;

字符串替换

update mytable set name = replace(name, 'cat', 'dog') where id=1 ;

联系我们

0574-55011290

QQ:248687950

邮件:admin@nbhao.org

工作时间:周一至周五,9:00-18:00,节假日休息

QR code