Re: swap relations to be able to execute a left join - Mailing list pgsql-general

From Karsten Hilbert
Subject Re: swap relations to be able to execute a left join
Date
Msg-id 20051209172544.GD5059@merkur.hilbert.loc
Whole thread Raw
In response to swap relations to be able to execute a left join  (David Rio Deiros <driodeiros@gmail.com>)
List pgsql-general
On Fri, Dec 09, 2005 at 09:16:15AM -0800, David Rio Deiros wrote:

> The other day, a coworker who loves mysql was complaining to me because
> he had a hard time to find out why this query didn't work on PostgreSQL:
...
>     FROM
>         Artifact_Revisions AR,
>         Revisions_to_Types RTT,
>         Artifact_Types AT
>     LEFT JOIN
>         Users U
>         on (U.user_id = AR.principal_user_id)
...
> Apparently, once he swapped the 1st (AR) and the 3rd (AT) relation in
> the FROM, the query worked.
...
> I am sure there is a good reason why you have to swap the relations
> in PostgreSQL. Anyone?

I should think his query is joining something other than
what he *thinks* it does...

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

pgsql-general by date:

Previous
From: William
Date:
Subject: Re: Solaris 10 Sun Studio 11 compile error configtest
Next
From: William
Date:
Subject: Re: PgSQL 8.1.0 Solaris w/ Sun's cc