Re: How would I write this query... - Mailing list pgsql-general

From Ragnar
Subject Re: How would I write this query...
Date
Msg-id 1146500531.11473.3.camel@localhost.localdomain
Whole thread Raw
In response to How would I write this query...  ("Jim Fitzgerald" <jfitz@spacelink.com>)
List pgsql-general
On sun, 2006-04-30 at 11:32 -0700, Jim Fitzgerald wrote:
>   I have two tables, one of them has names of people and an associated
> integer ID.  The other table is a list of the people (from the first table)
> by their ID number that have signed up for a class.  How would I write a
> query that would list all the people from the first table that do not have
> any entries in the second table?   Basically, I want a listing of all my
> people who have not signed up for the class.

try

SELECT * FROM people LEFT JOIN classes using (peopleid)
         WHERE classes.classid IS NULL;


gnari



pgsql-general by date:

Previous
From: Teodor Sigaev
Date:
Subject: Re: Use of ISpell dictionaries with tsearch2 - what is
Next
From: "Andrus"
Date:
Subject: Re: How to define + operator for strings