Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过连接PostgreSQL中的列进行更新_Postgresql_Syntax Error - Fatal编程技术网

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

通过连接PostgreSQL中的列进行更新,postgresql,syntax-error,Postgresql,Syntax Error,我需要通过将hotelcode与vendorcitycode(用下划线分隔)连接起来来设置hotelcode,如下所示 update schema.table_name set hotelcode = hotelcode+"_"+vendorcitycode) where vendorid = 'INV27' and vendorcitycode = 'LON' 注: hotelcode和vendorcitycode是类型为字符变化(100)的两列。 我使用的是PostgreS

我需要通过将hotelcode与vendorcitycode(用下划线分隔)连接起来来设置hotelcode,如下所示

update schema.table_name set
       hotelcode = hotelcode+"_"+vendorcitycode)
 where vendorid = 'INV27' and vendorcitycode = 'LON'
注:
hotelcode
vendorcitycode
是类型为
字符变化(100)
的两列。
我使用的是PostgreSQL 8.0。

我不知道这是否是您获得否决票的原因,但答案很容易在文档中找到。PostgreSQL版本8.0不受支持;你应该尽快安排升级。
UPDATE   table_name
SET      hotelcode = hotelcode || '_' || vendorcitycode
WHERE    (vendorid, vendorcitycode) = ('INV27', 'LON')