Subject | Re: [firebird-support] From Syntax - mine vs. Access |
---|---|
Author | Arno Brinkman |
Post date | 2005-08-22T17:24:53Z |
Hi,
Personally i prefer a LEFT JOIN above a RIGHT JOIN :
FROM
Product
JOIN VisItem ON (VisItem.Product = Product.ID)
JOIN VisProdParent ON (VisProdParent.VisItem = VisItem.ID)
JOIN VisProdBatch ON (VisProdBatch.ID = VisProdParent.VisProdBatch)
LEFT JOIN CustOrder ON (CustOrder.ID = VisItem.OrderNo)
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
General database development support:
http://www.databasedevelopmentforum.com
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Support list for Firebird and Interbase users :
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep :
news://newsgroups.firebirdsql.info
> Access: (note, I added the linebreak to make more readable)I doubt the above queries return the same resultset.
> =======
> FROM
> Product INNER JOIN (
> CustOrder RIGHT JOIN (
> VisProdBatch INNER JOIN (
> VisItem INNER JOIN VisProdParent ON VisItem.ID = VisProdParent.VisItem
> ) ON VisProdBatch.ID = VisProdParent.VisProdBatch
> ) ON CustOrder.ID = VisItem.OrderNo) ON Product.ID = VisItem.Product
> Mine: (attempt 1)
> =======
> FROM
> VisItem
> JOIN VisProdParent ON VisItem.ID = VisProdParent.VisItem
> JOIN VisProdBatch ON VisProdBatch.ID = VisProdParent.VisProdBatch
> RIGHT JOIN CustOrder ON CustOrder.ID = VisItem.OrderNo
> JOIN Product ON Product.ID = VisItem.Product
Personally i prefer a LEFT JOIN above a RIGHT JOIN :
FROM
Product
JOIN VisItem ON (VisItem.Product = Product.ID)
JOIN VisProdParent ON (VisProdParent.VisItem = VisItem.ID)
JOIN VisProdBatch ON (VisProdBatch.ID = VisProdParent.VisProdBatch)
LEFT JOIN CustOrder ON (CustOrder.ID = VisItem.OrderNo)
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
General database development support:
http://www.databasedevelopmentforum.com
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Support list for Firebird and Interbase users :
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep :
news://newsgroups.firebirdsql.info