From: Richard Broersma Jr <rabroersma@yahoo.com>
To: Richard Broersma Jr <rabroersma@yahoo.com>
To: tyrrill_ed@emc.com
To: pgsql-sql@postgresql.org
Subject: Re: Join question
Date: Tue, 21 Aug 2007 12:18:52 -0700 (PDT)
Message-ID: <663038.58978.qm@web31802.mail.mud.yahoo.com> (raw)
oops...
I meant "DISTINCT ON ( a_id )"
--- Richard Broersma Jr <rabroersma@yahoo.com> wrote:
> SELECT a.x, b.x
> FROM ( SELECT DISTINCT ON ( a_id ) a_id, b_id
^^
> FROM c ) AS c( a_id, b_id )
> INNER JOIN a
> ON c.a_id = a.id
> INNER JOIN b
> ON c.b_id = b.id;
>
> Regards,
> Richard Broersma Jr.
>
>
>
>
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, tyrrill_ed@emc.com
Subject: Re: Join question
In-Reply-To: <663038.58978.qm@web31802.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