列中查询嵌套数组

列中查询嵌套数组

Use jsonb_array_elements() in lateral join as many times as the depth of a json array which elements you want to compare:select schools->>'school_id' school_id, addresses->>'addr_id' addr_id, addresses->>'house_description' house_description, addresses->>'house_no' house_nofrom title_register_data,jsonb_array_elements(address_data->'schools') schools,jsonb_array_elements(schools->'addresses') addresseswhere addresses->>'house_description' = addresses->>'house_no'; school_id | addr_id | house_description | house_no-----------+---------+-------------------+---------- 1 | 4 | 1 | 1(1 row) 这篇关于如何在 postgres json 列中查询嵌套数组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-14 05:35