Hello,
    There are 2 ways of doing outer joins, both are relatively expensive
from the CPU time point of view
    1. Create a function that returns the ojined value, or null if the value
does not exists in the secod table
    2. Use a union beetwen a left join and a straight select with a where
condition. Next there's an example inspired from the Adison Westley book (I
suggest you grab a copy from the postgresql site. (/docs)

    select customer.name,salesorder.order_id from customer join salesorder
on customer.cust_id=salesorder.fk_cust_id union all select
customer.name,null::int4 from customer where customer.cust_id not in (select
fk_cust_id from salesorder);

    Probably an improvement here is to use exists on the second select, but
I didn't have the time to document.
    Anyway, this will not work embedded in a view ("union all" is not
supported in views).

                Alexander

"Nasdaq" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> The statement "Outer Join" is not available in Postgres ?
> Is there an extension provided by a third company that implement this
> functionnality ?
>
> If not do you know when this functionnality will be available in
> Postgres ?
>
> Thank
>
> Fred
>
> --
> TechBourse : le premier site en FRANCAIS dédié le NASDAQ
> http://www.techbourse.com


Reply via email to