selecting rows tagged with "a" but not "b" - Mailing list pgsql-sql

From 8q5tmkyqry@sneakemail.com
Subject selecting rows tagged with "a" but not "b"
Date
Msg-id 11366-1265031099-334353@sneakemail.com
Whole thread Raw
Responses Re: selecting rows tagged with "a" but not "b"  ("Milen A. Radev" <milen@radev.net>)
Re: selecting rows tagged with "a" but not "b"  (Andreas Gaab <A.Gaab@scanlab.de>)
Re: selecting rows tagged with "a" but not "b"  (Andreas Kretschmer <akretschmer@spamfence.net>)
List pgsql-sql
Hi,

I have a two tables:

article
articleID, name, content

tags
articleID, tag

I want to find all articles that are tagged with "a" but not "b"

how do I do this?

what I'd like to do is:

<wishful thinking>
select articleID from tags where tag="a"
SUBTRACT
select articleID from tags where tab="b"
</wishful thinking>

how do I do this in real SQL?

thanks

Darrell


pgsql-sql by date:

Previous
From: Leo Mannhart
Date:
Subject: Re: combine SQL SELECT statements into one
Next
From: "Milen A. Radev"
Date:
Subject: Re: selecting rows tagged with "a" but not "b"