The NATURAL JOIN operator can cause problems by equating columns you may not intend to be equated. For example, the following query generates unwanted results:
SELECT * FROM SalesOrders NATURAL JOIN Customers; |
The result of this query has no rows. SQL Anywhere internally generates the following ON clause:
FROM SalesOrders JOIN Customers ON SalesOrders.ID = Customers.ID |
The ID column in the SalesOrders table is an ID number for the order. The ID column in the Customers table is an ID number for the customer. None of them match. Of course, even if a match were found, it would be a meaningless one.
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |