Re: Outer join statement ? - Mailing list pgsql-sql

From Alexandru COSTIN
Subject Re: Outer join statement ?
Date
Msg-id Winr5.19$bo5.752@nreader1.kpnqwest.net
Whole thread Raw
List pgsql-sql
    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" <fb@techbourse.com> wrote in message
news:fb-3008002344340001@du-211-67.lyon.dialup.freesurf.fr...
> 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




pgsql-sql by date:

Previous
From: Jan Wieck
Date:
Subject: Re: [GENERAL] function
Next
From: Rini Dutta
Date:
Subject: optimal performance for inserts