PostgreSQL字符串追加和替换SQL
发表时间:2018-10-17 16:22 | 分类:PostgreSQL | 浏览:2,875 次
字符串追加
查询
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 ;