Re: Cartesian product?
Posted in 1995
On Wed, 18 Jan 1995, Jonathan Leffler wrote: } The FROM clause structure indicates that: } } * presult will be joined to either smple or batch, } * and either smple or batch will be joined to analyte. } } The WHERE clause joins batch and smple to presult, which is OK, but it also } joins analyte to presult and not to batch and smple, which is what is } causing the error message. } } You should look in the manual appendices for the one on complex outer joins } to see something of what I mean. It is Appendix H in the ISQL User Guide } (Version 4.0), Appendix G in the I4GL Reference Manual (Version 4.0). } Using more or less the notation developed there, the join structure implied } by the FROM clause should be: } } presult } | } | } smple ----- batch } | } | } analyte } } The positions of smple and batch could be switched. The join structure of } the WHERE clause is: } } presult } | } ------------------------ } | | | } batch smple analyte } } To work out what you should have written, we'd need to know quite a lot } about the data. Judging by the criteria you've written, I think that the } FROM clause could be: } } } Yours, } Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> Thanks to all that helped on this question. It was the reference of the "second" outered table to the "primary" table that caused the problem. I have since remodeled the code, and it works. It would be nice if one day INFORMIX would include nice help SOMEWHERE regarding errors. It wasn't terribly informative. B. ------------------------------------------------------------------------ |Brian P. Hampson Internet: brian@asl-labs.bc.ca | |System Administration, | |Analytical Service Labs Fidonet : Brian Hampson 1:153/733 | |Vancouver, BC | | | | Specialists in Environmental Chemistry | | | ------------------------------------------------------------------------