Postgresql query for objects in nested JSONB field

You should become familiar with JSON Functions and Operators. — #1 select * from example where content->’Item’->>’Name’ ilike ‘%dog%’ and content->’Item’->>’Spec’ ilike ‘%red%’ — #2 select * from example where content->’Item’->>’Name’ ilike ‘%dog%’ or content->’Item’->>’Spec’ ilike ‘%red%’ — #3 select distinct on(no) t.* from example t, lateral jsonb_each_text(content->’Item’) where value ilike ‘%dog%’; — and select … Read more