can anyone tell me how in Postgres to iterate over an array in select'e?
For example, there is an array
{{1,2,3,4,10,12},{1,4,3,3,25,14},{1,6,3,3,11,14}} I need to get the sum of 5 and 6 elements, and output the lines in descending order, that is, it should turn out like this
1,2,3,4,22 1,6,3,3,25 1,4,3,3,39 Refinement, these are separate columns, not a whole row.
Is it possible to do this somehow with a window function, but not through a function and a loop, namely, select? Everything is fine through my function. Here precisely to understand, whether it is possible to sort through an array.
Specification, initially the number of elements is unknown, that is, it is hard to select an array [1: 1], array [1: 2], etc., which will not work.