Re:

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Waldemar Bergstreiser <littlesuspense(at)web(dot)de>
Cc: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re:
Date: 2009-06-30 10:09:20
Message-ID: 407d949e0906300309g10886c99m83c451e99d3fafa4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jun 30, 2009 at 9:58 AM, Waldemar
Bergstreiser<littlesuspense(at)web(dot)de> wrote:
>> > -- c *= b *= a =* d =* f
>> > select * from a, outer( b, outer c), outer (d, outer f )
>> > where a.b_id = b.id and b.c_id = c.id and a.d_id = d.id and d.f_id = f.id;
>>
>> from a full join b on (a.id=b.id)
>> full join c on (b.id=c.id)
>> full join d
>>
>
> I guess, you don't get it. Probably so

I don't get it either. by *= do you mean the Oracle-style outer join?
in which case why is this not just

select * from a,
left outer join b on (a.b_id = b.id)
left outer join c on (b.c_id = c.id)
left outer join d on (a.d_id = d.id)
left outer join f on (d.f_id = f.id)

You can parenthesize it different ways but I think the result in this
case is actually the same.

> select * from a left outer join b on (a.b_id=b.id) ....
>
> But I don't see any clear way to specify that table C should be outer joined only if we got a row from table B.

Well that would be the default since if you get no row from b b.c_id
will be null.

--
greg
http://mit.edu/~gsstark/resume.pdf

In response to

  • Re: at 2009-06-30 08:58:47 from Waldemar Bergstreiser

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2009-06-30 10:15:02 Re: Am I in intransaction or in autocommit mode?
Previous Message Waldemar Bergstreiser 2009-06-30 08:58:47 Re: