Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id A6E26632563 for ; Fri, 12 Feb 2010 08:01:15 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 11761-03 for ; Fri, 12 Feb 2010 12:00:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sargon.lncsa.com (mail.lncsa.com [213.215.28.11]) by mail.postgresql.org (Postfix) with ESMTP id 5A6FC6327C0 for ; Fri, 12 Feb 2010 07:57:49 -0400 (AST) Received: from localhost (localhost.localdomain [127.0.0.1]) by sargon.lncsa.com (Postfix) with ESMTP id 66BDD301E6DA for ; Fri, 12 Feb 2010 12:57:48 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lncsa.com Received: from sargon.lncsa.com ([127.0.0.1]) by localhost (sargon.lncsa.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qIxL9ixiWGfI for ; Fri, 12 Feb 2010 12:57:48 +0100 (CET) Received: from zenon.apartia.fr (zenon.apartia.fr [10.0.3.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "zenon.apartia.fr", Issuer "ca.apartia.fr" (verified OK)) by sargon.lncsa.com (Postfix) with ESMTP id 4951D301E6D3 for ; Fri, 12 Feb 2010 12:57:48 +0100 (CET) Received: from galba.apartia.fr (galba.apartia.fr [10.0.3.119]) by zenon.apartia.fr (Postfix) with ESMTP id EDC39589A073A for ; Fri, 12 Feb 2010 12:57:47 +0100 (CET) Received: by galba.apartia.fr (Postfix, from userid 1000) id DA08FA3823; Fri, 12 Feb 2010 12:57:47 +0100 (CET) Date: Fri, 12 Feb 2010 12:57:47 +0100 From: Louis-David Mitterrand To: pgsql-sql@postgresql.org Subject: Re: "left join" not working? Message-ID: <20100212115747.GA21659@apartia.fr> Mail-Followup-To: pgsql-sql@postgresql.org References: <20100212111453.GA16318@apartia.fr> <34E07A4C4CDA4FFCB56CD63C675568ED@marktestcr.marktest.pt> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <34E07A4C4CDA4FFCB56CD63C675568ED@marktestcr.marktest.pt> User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.367 tagged_above=-10 required=5 tests=AWL=0.232, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201002/46 X-Sequence-Number: 33645 On Fri, Feb 12, 2010 at 11:35:02AM -0000, Oliveiros C, wrote: > My first guess is that > NULL fails the condition on your WHERE clause, > p.id_line = 1 > > So your WHERE clause introduces an additional level of filtering > that filters out the NULLs coming from the LEFT JOIN... So, if I understand correctly, a WHERE filters all results regardless of join conditions and can turn an OUTER JOIN into an INNER JOIN. Thanks for pointing that out!