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 tbl ( idObject int, idProperty int ); insert into tbl values (12, 1), (12, 2), (12, 3), (12, 4), (13, 1), (13, 2), (14, 1), (14, 4); with objects as ( select idObject from tbl where idProperty in (1,4) group by idObject having count(distinct idProperty) = 2 ) select * from tbl join objects using(idObject);

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

Copy Clear