Reputation: 315
How do I select a row only if group by does not contain a value.
Sample data:
CREATE TABLE tbl (
id serial NOT NULL ,
product int4 NULL,
family int4 NULL
);
insert into tbl values
(1,3,200),
(2,6,201),
(3,7,201),
(4,1,203),
(5,3,204),
(6,6,205),
(7,1,206);
http://sqlfiddle.com/#!9/744bc1/2
Find all products such that:
Upvotes: 1
Views: 450