SQLize Online / PHPize Online  /  SQLtest Online

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