我有options JSONB字段:

我可以得到JSONB数组:
SELECT "options" FROM "products";->
'[["black", "2"], ["white", "7"]]'::JSONB但是,我怎样才能制作数组呢?
->
ARRAY[ARRAY['black', '2'], ARRAY['white', '7']]发布于 2022-08-14 19:02:25
select (
select array_agg(
(select array_agg(s) from jsonb_array_elements_text(a) j2(s))
) from jsonb_array_elements(options) j1(a)
) from productshttps://stackoverflow.com/questions/73352821
复制相似问题