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 links ( id int primary key auto_increment ); insert into links values (1); create table blocks ( id int primary key auto_increment, link_id int, t text ); insert into blocks (link_id, t) values (1, 'Block1'), (1, 'Block3'), (1, 'Block3'); select * from blocks join ( select min(b.id) id from blocks b join links l on b.link_id = l.id where l.id = 1 ) fb on fb.id = blocks.id

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

Copy Clear