Subject Re: [ib-support] Help w/ SQL
Author Ann W. Harrison
At 08:03 AM 12/13/2000 -0800, Kevin Stanton wrote:

>The following SQL works as long as the join to the ORD_HDR table is
>commented out. As soon as I reinstate this table, the result set is empty.
>I thought a LEFT OUTER JOIN would include all records matched or unmatched.


>SELECT <stuff, all qualified>
>FROM <a bunch of tables, all combined with left joins>
>WHERE
> (COMPANY = '01') AND (DIVISION = '0') AND
> <a bunch of other conditions, none of the columns qualified>
>ORDER BY
> <a bunch of qualified columns>

The problem is in the WHERE clause. It's probably picking
up the company column from the ORD_HDR table rather than the
PI_SUM table. Qualify all those column references and the
problem will go away.


Regards,

Ann
www.ibphoenix.com
We have answers.