>>102922978
Any 3 rows or 3 rows with a distinct b.x's?
insert into a
with c as (select * from b where b.x in ('foo', 'bar', 'baz'))
select * from c where (select count(*) from c)=3;
insert into a
with c as (select * from b where b.x in ('foo', 'bar', 'baz'))
select * from c where (select count(distinct x) from c)=3;
That being said, are you sure you want to have inter-row dependencies?