【openGauss】openGauss对数组里面的每个值子查询的结果,再组成数组
/* openGauss对数组里面的每个值子查询的结果,再组成数组 */
with my_array as (
select array[1, 2, 3, 4, 5] a1
)
SELECT array(
SELECT val * 2 -- 这里可以写子查询
FROM unnest((select a1 from my_array)) as val) as doubled_array;
/* openGauss对数组里面的每个值子查询的结果,再组成数组 */
with my_array as (
select array[1, 2, 3, 4, 5] a1
)
SELECT array(
SELECT val * 2 -- 这里可以写子查询
FROM unnest((select a1 from my_array)) as val) as doubled_array;