Re: Exclusion List - Mailing list pgsql-sql

From Michael Richards
Subject Re: Exclusion List
Date
Msg-id 3B682E65.0001BD.93146@frodo.searchcanada.ca
Whole thread Raw
In response to Exclusion List  ("Michael Richards" <michael@fastmail.ca>)
List pgsql-sql
> "Michael Richards" <michael@fastmail.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);

I tried except but in this case I'd have to use this to extract the 
list of ids and then re-join it with users again to get the rest of 
the data from the users table :(

-Michael

_________________________________________________________________    http://fastmail.ca/ - Fast Free Web Email for
Canadians

pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Exclusion List
Next
From: "Richard Rowell"
Date:
Subject: Outer Join Syntax