X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id D7F899FB21E for ; Fri, 14 Jul 2006 01:16:39 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 26003-04-2 for ; Fri, 14 Jul 2006 01:16:29 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from obelix.askesis.nl (laudanum.demon.nl [82.161.125.16]) by postgresql.org (Postfix) with ESMTP id 5AE0E9FB35B for ; Fri, 14 Jul 2006 01:16:18 -0300 (ADT) Received: obelix 172.31.0.1 from 172.31.1.1 172.31.1.1 via HTTP with MS-WebStorage 6.0.6249 Received: from panoramix by obelix; 14 Jul 2006 06:16:16 +0200 Subject: Re: Can I do this smarter? From: Joost Kraaijeveld To: Aaron Bono Cc: pgsql-sql@postgresql.org In-Reply-To: References: <1152848488.6045.13.camel@localhost> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Fri, 14 Jul 2006 06:16:16 +0200 Message-Id: <1152850576.6045.15.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.6.2 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/209 X-Sequence-Number: 25783 Hi Aaron, On Thu, 2006-07-13 at 22:52 -0500, Aaron Bono wrote: > SELECT > invoices.objectid, > invoices.invoicenumber, > invoices.invoicedate, > salesorders.customer, > customers.customernumber, > customers.lastname > FROM invoices > INNER JOIN salesorders ON ( > salesorders.objectid = invoices.salesorderobjectid > ) > INNER JOIN customers ON ( > customers.objectid = salesorder.customer > ) > > You should do INNER and OUTER joins for connecting the tables by > their foreign keys. Thanks for the quick (and working ;-)) response. -- Groeten, Joost Kraaijeveld Askesis B.V. Molukkenstraat 14 6524NB Nijmegen tel: 024-3888063 / 06-51855277 fax: 024-3608416 web: www.askesis.nl