Re: How to find entries missing in 2nd table? - Mailing list pgsql-sql

From Richard Broersma Jr
Subject Re: How to find entries missing in 2nd table?
Date
Msg-id 20060711155201.22418.qmail@web31810.mail.mud.yahoo.com
Whole thread Raw
In response to How to find entries missing in 2nd table?  (alex-lists-pgsql@yuriev.com)
Responses Re: How to find entries missing in 2nd table?
List pgsql-sql
> Hi,
>     I realize I probably lost my marbles but I've been having a god
> awful time with a single query:
> 
> control:
>     ....
>     ....
>     controller_id    pk;
> 
> 
> datapack:
> 
>     controller_id    fk;
>     ....
>     ....
>     ....
> 
> I need to get all entries from the table control that are not listed in
> datapack.

SELECT C.CONTROLLER_ID

FROM CONTROL AS C  LEFT JOIN DATAPACK AS D ON ( C.CONTROLLER_ID = D.CONTROLLER_ID)

WHERE D.CONTROLLER_ID IS NULL;

Regards,

Richard Broersma Jr.   


pgsql-sql by date:

Previous
From: alex-lists-pgsql@yuriev.com
Date:
Subject: How to find entries missing in 2nd table?
Next
From: Scott Marlowe
Date:
Subject: Re: How to find entries missing in 2nd table?