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 tokens ( user_id int, regions int[] ); insert into tokens values (5, array[1,2,3]); CREATE TABLE regions ( id int, ru_name varchar(64) ); insert into regions values (1, 'Region 1'), (2, 'Region 2'),(3, 'Region 3'); SELECT ru_name FROM "tokens" JOIN regions ON regions.id = any (tokens.regions) WHERE user_id = 5 ;

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

Copy Clear