Re: Exclusion List

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Michael Richards" <michael(at)fastmail(dot)ca>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Exclusion List
Date: 2001-08-01 16:23:16
Message-ID: 10129.996682996@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Michael Richards" <michael(at)fastmail(dot)ca> writes:
> The reduction of the list doesn't seem to be terribly efficient. Here
> are some strategies I've been looking at:

> select id from users WHERE
> id not in (select userid from sentletters where lettertype=1) AND
> aclgroup IN (1,2);

Try an EXCEPT, along the lines of

(select id from users where conditions) except
(select userid from sentletters where other-conditions);

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Richards 2001-08-01 16:29:25 Re: Exclusion List
Previous Message Michael Richards 2001-08-01 15:28:44 Exclusion List