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

From Guy Rouillier
Subject Re: How would I write this query...
Date
Msg-id D4D1632DC736E74AB95FE78CD609007901260D@mtxexch01.add0.masergy.com
Whole thread Raw
In response to How would I write this query...  ("Jim Fitzgerald" <jfitz@spacelink.com>)
Responses Re: How would I write this query...  ("John D. Burger" <john@mitre.org>)
Re: How would I write this query...  (Alban Hertroys <alban@magproductions.nl>)
List pgsql-general
Jim Fitzgerald wrote:
> Hi -
>
>   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.

select *
from people
where id not in
(
select id
from class_registration
)

--
Guy Rouillier


pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Is PostgreSQL an easy choice for a large CMS?
Next
From: Philip Hallstrom
Date:
Subject: Re: Is PostgreSQL an easy choice for a large CMS?