Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0ELUaV03408 for ; Mon, 14 Jan 2002 16:30:36 -0500 (EST) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.5.2) with HTTP id 601184; Mon, 14 Jan 2002 13:30:36 -0800 From: "Josh Berkus" Subject: Re: nested inner join help To: "Darryl M. Wolski" , X-Mailer: CommuniGate Pro Web Mailer v.3.5.2 Date: Mon, 14 Jan 2002 13:30:36 -0800 Message-ID: In-Reply-To: <000801c1973d$75ea1980$ae00a8c0@arbour> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200201/145 X-Sequence-Number: 6233 Darryl, In Postgres, neither the parentheses nor the word "INNER" are required. You will significantly simplify your life if you get rid of them, and clean up your presentation of SQL text in order to debug your own joins. One significant MSAccess <==> Postgres conflict is that Postgres assumes that parens in the FROM clause represent subselects (I think), while MS Access uses parens to organize JOINs. Postgres behavior is, of course, more SQL92 correct. SELECT orderlines.quantity, products.productname, products.productcost, customers.custlname,customers.custfname FROM orders JOIN orderlines ON orders.orderid = orderlines.lnkorderid JOIN customers ON customers.custid = orders.lnkcustid JOIN products ON products.productid = orderlines.lnkproductid WHERE orders.orderid=2; -Josh Berkus ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco