DEV Community

Cover image for Extract Array of object data in MySql DB
Ashwani Singh
Ashwani Singh

Posted on

Extract Array of object data in MySql DB

// your_column = [{id: 1, name: "Tom", age: 30}];

SELECT * FROM your_table 
WHERE json_contains(your_column->'$[*].id', json_array("your_id_to_match"));

Enter fullscreen mode Exit fullscreen mode

Top comments (0)