From: | "Edmar Wiggers" <edmar(at)brasmap(dot)com> |
---|---|
To: | "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "pgsql-general" <pgsql-general(at)postgresql(dot)org> |
Subject: | RE: prefer (+) oracle notation |
Date: | 2000-10-19 23:00:58 |
Message-ID: | NEBBIAKDCDHFGJMLHCKIEEHHCAAA.edmar@brasmap.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Sorry, maybe I confused you.
The Oracle way:
I failed to mention that (+) are specific to outer joins.
There is no way to express a join in the from clause.
Everything goes on the where clause: joins and "filter conditions".
In the where clause, it is common practice to express to specify first
your joins and after your filters.
Example:
select a.id,a.size,b.*,c.id,c.color
from table_a a, table_b b, table_c c
where
a.b_id = b.id and
a.c_id = c.id(+) and
a.size < 1000 and
b.weight > 10;
This is a select from 3 tables, where a and b are regularly joined, but c is
outer joined. That is, the query is likely to return null values on c.id and
c.color.
When you are joining 8 tables, that syntax becomes clearer.
I believe the standard syntax for that might be:
select a.id,a.size,b.*,c.id,c.color
from ((table_a a join table_b b on a.b_id = b.id) outer join table_c c on
a.c_id = b.id)
where
a.size < 1000 and
b.weight > 10;
To me, not so readable. But of course I can live with that.
From | Date | Subject | |
---|---|---|---|
Next Message | lesstif | 2000-10-19 23:20:06 | what is the best way to set-up keywords in tables and Queries ? |
Previous Message | Philip Hallstrom | 2000-10-19 22:44:57 | Re: Any risk in increasing BLCKSZ to get larger tuples? |