Reputation: 91
In PotgreSQL, how do I write a query to replace some values in an int4 array?
{1,2,10} -> {1,2,999}
{2,3,10} -> {2,3,999}
is what we are aiming for.
Upvotes: 0
Views: 115
Reputation: 35910
Seems like you want to replace 10 with 999, you can use array_replace
array_replace(your_column, 10, 999)
Upvotes: 2