Subject Re: [ib-support] Query Results problem
Author gboutwel@valleyhope.com
On 10 Jun 2003 at 10:28, Svein Erling Tysvaer wrote:

> In your join you say that Firebird is to return records of A, whether or
> not there is a matching record of D and E - and then in your WHERE-clause
> you say that you should restrict returning to certain values of the same
> tables. I think that in a LEFT [OUTER] JOIN, the only proper way to
> restrict records of tables at the right side of the join is within the JOIN
> criteria, not in the WHERE clause (I think I read it in some Interbase 5.6
> documentation). Try changing your query to something like:
>
> FROM
> TALBEA A LEFT JOIN TABLEB B ON (A.FK1 = B.PK)
> LEFT JOIN TABLEB C ON (A.FK2 = C.PK)
> LEFT JOIN TABLEC D ON (A.FK3 = D.PK AND D.YETANOTHERFIELD IS NULL )
> LEFT JOIN TABLEC E ON (A.FK4 = E.PK AND E.YETANOTHERFIELD IS NULL )
> WHERE
> A.PK = :ParameterizedPK

This is the way I ORIGINALLY had it and I was still getting the
same result, a null result set when I should get several rows of
data. I will try it again this way.

--
George Boutwell,
Programmer II - Valley Hope Association
gboutwel@...