Search Postgresql Archives

Re:

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> >> > -- 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)
> 

The equal expression would be like this:

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

and that is a double length of original SQL and has not very clear syntax in my opinion.
Additionally it can be very funny if we try to append a join conditions like "c.iso = d.iso"

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

I'm not sure. 

> > 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.
> 

and if I have a row in table C where c.id is null? A don't know.

I found a good explanation about informix outer joins. 

http://savage.net.au/SQL/outer-joins.html

Please take a look at that.


________________________________________________________________
Neu: WEB.DE Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://produkte.web.de/go/02/


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux