1.List ip 类似于[“1.1.1.1”,“2.2.2.2”] 需要输出把ip单列出来
select jsonb_array_elements_text(ip) as ip from table;
2.cast(ip::jsonb->>0 as INTEGER) 取出第一个
3.array_to_string(ARRAY_AGG(b.id),’,’) 把属于父级以下的提炼出来
postgresql的jsonb的用法一些
最新推荐文章于 2024-07-19 17:50:08 发布
1.List ip 类似于[“1.1.1.1”,“2.2.2.2”] 需要输出把ip单列出来
select jsonb_array_elements_text(ip) as ip from table;
2.cast(ip::jsonb->>0 as INTEGER) 取出第一个
3.array_to_string(ARRAY_AGG(b.id),’,’) 把属于父级以下的提炼出来