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 test ( "id" serial, "hash" varchar(64), "on" boolean ); insert into test values (1, 'aaa', true), (2, 'aaa', true), (3, 'bbb', true), (4, 'aaa', false), (5, 'ccc', true) ; select * from test join ( select "hash" from test where "on" is true order by random() limit 1 ) t on t.hash = test.hash;

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

Copy Clear