通过连接PostgreSQL中的列进行更新

nam*_*olk 12 postgresql syntax-error

我需要通过将其与vendorcitycode(由下划线分隔)连接来设置酒店代码,如下所示.

update schema.table_name set
       hotelcode = hotelcode+"_"+vendorcitycode)
 where vendorid = 'INV27' and vendorcitycode = 'LON'
Run Code Online (Sandbox Code Playgroud)

注意: hotelcode并且vendorcitycode是两列类型character varying(100).我使用PostgreSQL 8.0.

Qua*_*noi 20

UPDATE   table_name
SET      hotelcode = hotelcode || '_' || vendorcitycode
WHERE    (vendorid, vendorcitycode) = ('INV27', 'LON')
Run Code Online (Sandbox Code Playgroud)