Subject Re: Query Results problem
Author gboutwel@valleyhope.com
>you're hiding things from us.

Trying not to, but being in the medical industry makes it hard for me to release
actual statements.

>There's no way you can get a plan like

>>PLAN JOIN (JOIN (A INDEX
>>(RDB$PRIMARY243,RDB$FOREIGN254),B INDEX
>>(RDB$PRIMARY9)),C INDEX (RDB$PRIMARY9))

>unless you have a where clause (it has to use natural for TALBEA). My guess
>is that your problem in some way is related to wrong usage of the where
>clause, at least I cannot see anything in your select that should make your
>first statement fail to produce a result if the second does.

That's what I was afraid of, that seems to be what all my attempts at it are telling
me, but it still doesn't explain why I'm getting incorrect results from the first query. :(
Any idea why the first query returns incorrect results, when the WHERE doesn't
have anything it it that SHOULD limit those results (at least not in a way that should
return the results that I'm getting)? What's bad is I get the correct results if I
remove the JOIN involving TABLEC (and references to TABLEC), so it's something
with TABLEC. It doesn't seem to matter if I only JOIN TABLEC once, I still get an
empty result set when I should be getting some rows returned.

I actually have a couple WHEREs that I'd use with this if I could get it to return the
correct result set, but the main WHERE that would be used is:

WHERE
A.PK = :ParameterizedPK AND
D.YETANOTHERFIELD IS NULL AND
E.YETANOTHERFIELD IS NULL

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