PostgreSQL - JSON and JSONB
Which of the following is the correct syntax to check if a JSONB column data contains the JSON {"key": "value"}?
SELECT * FROM table WHERE data ___ '{"key": "value"}'::jsonb;Which of the following is the correct syntax to check if a JSONB column data contains the JSON {"key": "value"}?
SELECT * FROM table WHERE data ___ '{"key": "value"}'::jsonb;@> operator checks if the left JSONB contains the right JSONB.data contains the JSON, use data @> '{"key": "value"}'::jsonb.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions