I have a table called test. Inside this table is a column called letters of jsonb. Inside this column is data like [], ["a"], ["b"], ["a", "b","c"] but there are no key values. How can I query all the rows that contains one of these like "b" (So, the last 2)?
What I have isn't currently working.
I'm trying:
SELECT *
FROM db.test
WHERE (letters->>'')::jsonb ?| array['b'];
Also tried
SELECT *
FROM db.test
WHERE letters::jsonb ?| array['b'];
SELECT *
FROM db.test
WHERE letters::jsonb ? 'b';