如何对sql中某个字段里的所有值添加相同的字符

来源:互联网 发布:java获取鼠标坐标 编辑:程序博客网 时间:2024/06/05 15:09

表名:test 字段 test_code

有两种方法:
第一种:

 update test set test_code='00'||test_code  where test_name='coco';

第二种:

update test set test_code='00'+test_code  where test_name='coco';

总结:
第一种方法在postgreSQL中可以实现!

0 0