Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gAyzX-00019l-Q7 for pgsql-docs@arkaria.postgresql.org; Fri, 12 Oct 2018 15:04:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gAyzW-0004AJ-5a for pgsql-docs@arkaria.postgresql.org; Fri, 12 Oct 2018 15:04:38 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gAyzV-0004A1-Sr for pgsql-docs@lists.postgresql.org; Fri, 12 Oct 2018 15:04:38 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gAyzT-00050S-1V for pgsql-docs@lists.postgresql.org; Fri, 12 Oct 2018 15:04:36 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1gAyzR-0006e6-Eu; Fri, 12 Oct 2018 11:04:33 -0400 Date: Fri, 12 Oct 2018 11:04:33 -0400 From: Bruce Momjian To: KES Cc: "David G. Johnston" , "pgsql-docs@lists.postgresql.org" Subject: Re: Ambiguous usage of 'any' in explanation Message-ID: <20181012150433.GA12966@momjian.us> References: <153701242703.22334.1476830122267077397@wrigleys.postgresql.org> <20181011210934.GG7807@momjian.us> <5831541539340923@iva8-3af116a85b74.qloud-c.yandex.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5831541539340923@iva8-3af116a85b74.qloud-c.yandex.net> User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Oct 12, 2018 at 01:42:03PM +0300, KES wrote: > -   The result is NULL if the comparison does not return true for any row, > +   The result is NULL if no comparison with a subquery row returns true, >     and it returns NULL for at least one row. > -The result of ANY is “true” if the comparison returns true for any subquery > row. The result is “false” if the comparison returns false for every subquery > row (including the case where the subquery returns no rows). The result is NULL > if the comparison does not return true for any row, and it returns NULL for at > least one row. >   > Similary to: > >The result of ALL is "false" even if *at least one*  row yield false >   > +The result of ANY is "true" if at least one row yields true. > The result of ANY is "false" if all rows yield false > The result of ANY is NULL if no one row yelds true and at least one row yields > NULL > When subquery return no rows the result of ANY is "false" >   > sentences are short, easy to spot when and how result is changed Sorry, but I don't like this wording. The problem is that the comparison has two row sets --- the left-hand side, and the right-hand side. Each row on the left-hand side is compared with the row set on the right. I also don't like people thinking about the result of ANY since it is really ANY that is being used. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +