给定嵌套数组:
SELECT ARRAY[ARRAY[1, 2, 3], ARRAY[4, 5, 6], ARRAY[7, 8, 9]];
-------------------------------------------------------------
{{1,2,3},{4,5,6},{7,8,9}}
如何将数组拆分成行?
{1,2,3}
{4,5,6}
{7,8,9}
我已尝试unnest
,但它适用于内部元素:
SELECT unnest(ARRAY[ARRAY[1, 2, 3], ARRAY[4, 5, 6], ARRAY[7, 8, 9]]);
---------------------------------------------------------------------
1
2
3
4
5
6
7
8
9