Re: How to find entries missing in 2nd table?

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to find entries missing in 2nd table?
Date: 2006-07-11 16:04:45
Message-ID: 5.2.1.1.0.20060711115934.00a4f2e0@pop6.sympatico.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

At 10:19 AM 7/11/06, alex-lists-pgsql(at)yuriev(dot)com wrote:
>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 controller.controller_id from controller
left join datapack on controller.controller_id = datapack.controller_id
where datapack.controller_id is null;

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Milen A. Radev 2006-07-11 16:57:20 Re: How to find entries missing in 2nd table?
Previous Message Scott Marlowe 2006-07-11 16:00:46 Re: How to find entries missing in 2nd table?