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

From: "Oliveiros C," <oliveiros(dot)cristina(at)marktest(dot)pt>
To: <8q5tmkyqry(at)sneakemail(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: selecting rows tagged with "a" but not "b"
Date: 2010-02-01 13:44:57
Message-ID: EF7B374E13D54540A126F67B8154A2F7@marktestcr.marktest.pt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Darrell,

Can you provide a little more information and background on your problem.
please?

What values can the "tag" column assume? Just "a" and "b" ?

Both?

Please give examples of table contents and desired output, your mail doesn't
contain enough info to give you more advises

Thank you

Best,
Oliveiros

----- Original Message -----
From: <8q5tmkyqry(at)sneakemail(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Sent: Monday, February 01, 2010 1:31 PM
Subject: [SQL] selecting rows tagged with "a" but not "b"

> 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
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Gaab 2010-02-01 13:50:44 Re: selecting rows tagged with "a" but not "b"
Previous Message 8q5tmkyqry 2010-02-01 13:31:38 selecting rows tagged with "a" but not "b"