pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Broersma Jr <rabroersma@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Re: How to find entries missing in 2nd table?
Date: Tue, 11 Jul 2006 08:52:01 -0700 (PDT)
Message-ID: <20060711155201.22418.qmail@web31810.mail.mud.yahoo.com> (raw)
In-Reply-To: <20060711141951.GA17936@s2.yuriev.com>

> 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.
    



view thread (13+ messages)  latest in thread

Message-ID: <20060711155201.22418.qmail@web31810.mail.mud.yahoo.com>
Permalink:  ../20060711155201.22418.qmail@web31810.mail.mud.yahoo.com/
Also on:    postgresql.org/message-id/20060711155201.22418.qmail@web31810.mail.mud.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rabroersma@yahoo.com
  Subject: Re: How to find entries missing in 2nd table?
  In-Reply-To: <20060711155201.22418.qmail@web31810.mail.mud.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox