By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE members(ID INT,Name VARCHAR(50));
INSERT INTO members VALUES (7,'DD');
CREATE TABLE clubhouse(id INT,members VARCHAR(50));
INSERT INTO clubhouse VALUES (55,'["7","8","9"]');
select *
from members m
where exists (
select 1
from clubhouse c
where json_contains(c.members, concat('"', m.id, '"'))
AND c.id = 55
)
ID | Name |
---|---|
7 | DD |