Re: help on a query

From: sad <sad(at)bankir(dot)ru>
To: Thomas F(dot)O'Connell <tfo(at)sitening(dot)com>, mmurrain(at)dbdes(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: help on a query
Date: 2004-10-08 04:44:23
Message-ID: 200410080844.23298.sad@bankir.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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;

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message CHRIS HOOVER 2004-10-08 13:02:00 Re: help on a query
Previous Message Thomas F.O'Connell 2004-10-08 03:10:33 Re: help on a query