I have 3 rows of array (type, text) in my PostgreSQL 9.5 database like follows:
ID array
1 "112,292,19.3"
2 "203,383,22.1"
3 "136,226,18.9,286,346,27.1,346,406,6.5"
There are some array elements which are greater than 360. I want to replace them on a condition that if any array element > 360 then element - 360 so that the replaced array be like:
ID array
1 "112,292,19.3"
2 "203,23,22.1"
3 "136,226,18.9,286,346,27.1,346,46,6.5"
How can I replace values greater than 360?
modas in my answer example. of course it will give replace 721 with 1, not 361, but I have an impression it's what you finaly will want?..