selecting rows tagged with "a" but not "b"

Поиск
Список
Период
Сортировка
От 8q5tmkyqry@sneakemail.com
Тема selecting rows tagged with "a" but not "b"
Дата
Msg-id 11366-1265031099-334353@sneakemail.com
обсуждение исходный текст
Ответы 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>)
Список 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 по дате отправления:

Предыдущее
От: Leo Mannhart
Дата:
Сообщение: Re: combine SQL SELECT statements into one
Следующее
От: "Milen A. Radev"
Дата:
Сообщение: Re: selecting rows tagged with "a" but not "b"