X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 892929FB227 for ; Tue, 11 Jul 2006 14:03:43 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 89084-02 for ; Tue, 11 Jul 2006 14:03:40 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web31809.mail.mud.yahoo.com (web31809.mail.mud.yahoo.com [68.142.207.72]) by postgresql.org (Postfix) with SMTP id 7320B9FB221 for ; Tue, 11 Jul 2006 14:03:40 -0300 (ADT) Received: (qmail 65500 invoked by uid 60001); 11 Jul 2006 17:03:39 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=G7V3hQSAc3htkDRMwn8ukx20toiop7cC59E0qV26EMKjQ3Nxlq5QX30Zk77uIsGlWVIi12uLcNIZascLr094eqDqgLZA6v8kNh+J8XOGLMaEuIYsOh3czY9i1syNRbN3QmLeu+A5YZ/YvVSu7EGlujjzGYteWY8gzpXBW9ICGzo= ; Message-ID: <20060711170339.65498.qmail@web31809.mail.mud.yahoo.com> Received: from [63.203.180.122] by web31809.mail.mud.yahoo.com via HTTP; Tue, 11 Jul 2006 10:03:39 PDT Date: Tue, 11 Jul 2006 10:03:39 -0700 (PDT) From: Richard Broersma Jr Subject: Re: How to find entries missing in 2nd table? To: SQL Postgresql List MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/185 X-Sequence-Number: 25759 --- Richard Broersma Jr wrote: > > >> 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; > > > > > > > > > Or > > (SELECT controller_id FROM control) > > EXCEPT > > Good point! But don't forget to include the list. :-) > > Regards, > > Richard Broersma Jr. > > (SELECT controller_id FROM datapack) > > ? > > > > -- > > Milen A. Radev > > > >