I have the following table:
\'committee\' table
commname profname
========================
commA bill
commA jack
commA piper
commB bi
Your innermost select isn't using anything from itself in its where clause, so it's always finding something for piper. Try
select distinct b.profname from committee b
where not exists (
select commname from committee a
where a.profname = 'piper' and not exists (
select commname from committee c
where c.profname=b.profname and c.commname=a.commname
)
);