Re: Trouble with an outer join - Mailing list pgsql-novice

From Martin Foster
Subject Re: Trouble with an outer join
Date
Msg-id 433749A4.6030205@ethereal-realms.org
Whole thread Raw
In response to Re: Trouble with an outer join  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
List pgsql-novice
Stephan Szabo wrote:
>
>
> Unfortunately, I don't know of good documentation that's particularly
> detailed and understandable (but admittedly I've not looked carefully).
> The spec is fairly precise but mostly incomprehensible.
>
> ----
>
> Roughly speaking,
> t1 Left outer join t2 on (condition) is defined as:
>  select * from tn
>   union all
>  select * from xn1
> where
>  tn is the multiset of rows of the cartesian product of t1 and t2 for
> which condition is true
>  xn1 is the set of rows in t1 that have no row in tn extended with NULLs
> to the right (ie, rows in t1 for which no joining to a row in t2 on
> condition returned true).
>
> Conditions in WHERE would be then applied to the output of the above.
>
> ----
>
>  Conditions in the on clause control whether a row from t1 matches to a
> row of t2 and is part of tn or is extended by NULLs and is part of xn1.
>  Conditions in the where clause then apply and only allow through rows
> that meet the criteria.


I learned how to do joins on an Oracle 7 server.  So the use of *= or =*
was the way an outer join was done.  Needless to say, the JOIN clause is
a bit different and at times seems a little less then obvious.

However from what you said, this would explain why the addition of AND
d.RealmName='Horror' works as expected.    It limits which rows are
joined from the RealmDesign table.

Thanks!

    Martin Foster
    martin@ethereal-realms.org



pgsql-novice by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Trouble with an outer join
Next
From: Michael Fuhr
Date:
Subject: Re: View