Subject | Re: [ib-support] Left Outer Join |
---|---|
Author | Helen Borrie |
Post date | 2002-06-21T12:52:41Z |
At 12:46 PM 21-06-02 +0000, you wrote:
syntax. You actually have two joins here and no WHERE predicates. As a
rule of thumb, use one syntax or the other. If you are doing anything
other than inner joins, you *must* use explicit joins.
Correct the original query:
SELECT Table1.Field1,
Table2.Field1,
Table3.Field1
FROM Table1
JOIN Table3
ON Table1.Field3 = Table3.Field2
LEFT OUTER JOIN Table2
ON Table1.Field2=Table2.Field2
heLen
All for Open and Open for All
Firebird Open SQL Database · http://firebirdsql.org ·
http://users.tpg.com.au/helebor/
_______________________________________________________
>Hi all!Yes, here you have a horrible admixture of implicit and explicit join
>
>I've got a problem with a query contains JOIN and WHERE.
>Table2.Field1 has same (wrong) value in all rows. (All the others is
>fine.)
>
>
>SELECT Table1.Field1,
>Table2.Field1,
>Table3.Field1
>FROM Table1,Table3
>LEFT OUTER JOIN Table2
>ON Table1.Field2=Table2.Field2
>WHERE Table1.Field3=Table3.Field2
>
>If remove WHERE query working properly:
>
>SELECT Table1.Field1,
>Table2.Field1,
>FROM Table1
>LEFT OUTER JOIN Table2
>ON Table1.Field2=Table2.Field2
>
>Any ideas?
syntax. You actually have two joins here and no WHERE predicates. As a
rule of thumb, use one syntax or the other. If you are doing anything
other than inner joins, you *must* use explicit joins.
Correct the original query:
SELECT Table1.Field1,
Table2.Field1,
Table3.Field1
FROM Table1
JOIN Table3
ON Table1.Field3 = Table3.Field2
LEFT OUTER JOIN Table2
ON Table1.Field2=Table2.Field2
heLen
All for Open and Open for All
Firebird Open SQL Database · http://firebirdsql.org ·
http://users.tpg.com.au/helebor/
_______________________________________________________