SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
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 ChatGPT!

Copy Clear