Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/74.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.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中int数组中的部分值的查询_Sql_Postgresql - Fatal编程技术网

用于替换PostgreSQL中int数组中的部分值的查询

用于替换PostgreSQL中int数组中的部分值的查询,sql,postgresql,Sql,Postgresql,在PotgreSQL中,如何编写查询来替换int4数组中的某些值 {1,2,10}->{1,2999} {2,3,10}->{2,3999} 这就是我们的目标。似乎您想用999替换10,您可以使用array\u replace array_replace(your_column, 10, 999) 似乎要将10替换为999,可以使用array\u replace array_replace(your_column, 10, 999) 非常感谢你!由于我想更新表,下面的查询似乎要执行upd

在PotgreSQL中,如何编写查询来替换int4数组中的某些值

{1,2,10}->{1,2999}

{2,3,10}->{2,3999}


这就是我们的目标。

似乎您想用999替换10,您可以使用
array\u replace

array_replace(your_column, 10, 999) 

似乎要将10替换为999,可以使用
array\u replace

array_replace(your_column, 10, 999) 

非常感谢你!由于我想更新表,下面的查询似乎要执行
updatetablesetcolumn=array\u replace(column,10999)非常感谢!由于我想更新表,下面的查询似乎要执行
updatetablesetcolumn=array\u replace(column,10999)