Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
create table tbl (id, home JSON, away JSON); insert into tbl values (1, '{"id":10,"valuet":"a"}','{"id":11,"valuet":"a"}'), (2, '{"id":11,"valuet":"b"}','{"id":10,"valuet":"a"}'), (3, '{"id":10,"valuet":"c"}','{"id":20,"valuet":"a"}'), (4, '{"id":40,"valuet":"23"}','{"id":10,"valuet":"a"}'); select * from tbl where json_contains(home, '11', '$.id');

Stuck with a problem? Got Error? Ask AI support!

Copy Clear