Search Postgresql Archives

Re: How would I write this query...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux