oops...
I meant "DISTINCT ON ( a_id )"
--- Richard Broersma Jr <rabroersma(at)yahoo(dot)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.
>
>
>
>