From: sad <sad@bankir.ru>
To: Thomas F.O'Connell <tfo@sitening.com>
To: mmurrain@dbdes.com
Cc: pgsql-sql@postgresql.org
Subject: Re: help on a query
Date: Fri, 8 Oct 2004 08:44:23 +0400
Message-ID: <200410080844.23298.sad@bankir.ru> (raw)
In-Reply-To: <9E089E3A-18D7-11D9-936A-000D93AE0944@sitening.com>
References: <4166036B.1020001@murrain.net>
<9E089E3A-18D7-11D9-936A-000D93AE0944@sitening.com>
On Friday 08 October 2004 07:10, Thomas F.O'Connell wrote:
> A query that should get the job done is:
>
> SELECT registration_id
> FROM registrations r
> WHERE NOT EXISTS (
> SELECT 1
> FROM receipts
> WHERE registration_id = r.registration_id
> );
Don't, PLEASE, don't !!!
drive this way :
SELECT r.registration_id
FROM registrations AS r
LEFT OUTER JOIN receipts AS rec
ON rec.registration_id = r.registration_id
WHERE rec.registration_id IS NULL;
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: sad@bankir.ru, tfo@sitening.com, mmurrain@dbdes.com
Subject: Re: help on a query
In-Reply-To: <200410080844.23298.sad@bankir.ru>
* 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