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 table_1 (id int, array_id json); INSERT INTO table_1 VALUES ( 1, '[1000003440,1000000356,1000000454]' ); CREATE TABLE table_2 (id int); INSERT INTO table_2 VALUES (1000003440), (1000000356), (1000000454); SELECT * FROM table_1 T1 LEFT JOIN table_2 T2 ON JSON_CONTAINS( array_id, CAST(T2.`id` AS JSON), '$' );

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

Copy Clear