By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
create table your_table (data text)
insert into your_table values
('{"homeWidgetToShow":"chat_and_notes","official":false,"nationalFederation":false,"categories":[],"activities":{"0":2,"2":7,"1":3},"clubsBlackList":[],"privateMembers":false,"alwaysShowDescription":false,"restrictMembersFromPositingForums":false}'),
('{"homeWidgetToShow":"chat_and_notes","official":false,"nationalFederation":false,"categories":[],"clubsBlackList":[],"privateMembers":false,"alwaysShowDescription":false,"restrictMembersFromPositingForums":false}'),
('{"homeWidgetToShow":"chat_and_notes","official":false,"nationalFederation":false,"categories":[],"activities":{"0":2,"2":3,"1":2},"clubsBlackList":[],"privateMembers":false,"alwaysShowDescription":false,"restrictMembersFromPositingForums":false}'),
('{"homeWidgetToShow":"chat_and_notes","official":false,"nationalFederation":false,"categories":[],"activities":{"0":2,"2":7,"1":5},"clubsBlackList":[],"privateMembers":false,"alwaysShowDescription":false,"restrictMembersFromPositingForums":false}')
Records: 4 Duplicates: 0 Warnings: 0
SELECT *
FROM your_table
WHERE 3 MEMBER OF(data->>'$.activities.*')
data |
---|
{"homeWidgetToShow":"chat_and_notes","official":false,"nationalFederation":false,"categories":[],"activities":{"0":2,"2":7,"1":3},"clubsBlackList":[],"privateMembers":false,"alwaysShowDescription":false,"restrictMembersFromPositingForums":false} |
{"homeWidgetToShow":"chat_and_notes","official":false,"nationalFederation":false,"categories":[],"activities":{"0":2,"2":3,"1":2},"clubsBlackList":[],"privateMembers":false,"alwaysShowDescription":false,"restrictMembersFromPositingForums":false} |