Question :
I have a column in PostgreSQL with jsonb datatype. I need to check one key whether it exists in that column or not by executing query.
Answer :
To find all the rows in a table where the data
column contains the key mykey
on the top level, use
SELECT * FROM mytable
WHERE data ? 'mykey';