From: nospam4@pobox.com
To: pgsql-sql@postgresql.org
Subject: A simple join question that may stump you
Date: 25 Sep 2001 20:01:06 -0700
Message-ID: <89c01029.0109251901.3dcb5d77@posting.google.com> (raw)
OK, I have 2 tables, table A:
ID FLAG
----- -----
1 1
2 1
2 2
3 1
3 2
3 3
and table B:
FLAG
-----
1
2
I want to find all id's from table A that have every flag in table B
but no extra flags. So, I'd end up with:
ID
-----
2
As id 2 has both flag 1 and flag 2, id 1 doesn't have flag 2, and id 3
has flag 3.
I know it can be done, 'cause I've done it in the past, but I've spent
hours on this to no avail. Surfing the net proved fruitless as well.
Any help would be greatly appreciated.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: nospam4@pobox.com
Subject: Re: A simple join question that may stump you
In-Reply-To: <89c01029.0109251901.3dcb5d77@posting.google.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox