X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 09675310102 for ; Fri, 27 Jun 2003 15:07:07 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 90291-01 for ; Fri, 27 Jun 2003 12:06:56 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id E9040310177 for ; Fri, 27 Jun 2003 12:06:55 -0300 (ADT) Received: (qmail 15752 invoked by uid 500); 27 Jun 2003 15:10:25 -0000 Date: Fri, 27 Jun 2003 10:10:25 -0500 From: Bruno Wolff III To: =?iso-8859-1?Q?Egy=FCd?= Csaba Cc: pgsql-sql@postgresql.org Subject: Re: Getting all rows even if not a member of any groups Message-ID: <20030627151025.GE15269@wolff.to> Mail-Followup-To: =?iso-8859-1?Q?Egy=FCd?= Csaba , pgsql-sql@postgresql.org References: <11362.1056313692@www59.gmx.net> <00bd01c33c9d$1b584e90$230a0a0a@compaq> <20030627140854.GA15269@wolff.to> <00e501c33cb6$f4cc4cd0$230a0a0a@compaq> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <00e501c33cb6$f4cc4cd0$230a0a0a@compaq> User-Agent: Mutt/1.5.4i X-Archive-Number: 200306/318 X-Sequence-Number: 14076 On Fri, Jun 27, 2003 at 16:18:10 +0200, Együd Csaba wrote: > > This is absolutelly what I want, but I can't understand how it is working. > Where can I find a descriptive (tale-like, for kids ... :) ) documentation > about using joins? If you look at the documentation for the select command and page down a bit there is a description of join syntax. Note that in 7.4 using the explicit join syntax won't force join order. (This really only affects cross joins and inner joins; left and right joins normally can't be reordered.) You need a left join to pick up products that aren't in any group. The parenthesis changed the join order so that group names were attached to group ids before group ids were joined to products. This can have performance implications. I think that this is probably the faster way, but the other option would to have been to make the second join a left join as well.