X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4755ED1B169 for ; Mon, 14 Jun 2004 17:07:35 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 04581-08 for ; Mon, 14 Jun 2004 20:07:30 +0000 (GMT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id 5AE38D1B19A for ; Mon, 14 Jun 2004 17:07:27 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 15F51359D2; Mon, 14 Jun 2004 13:07:29 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 1461B359D1; Mon, 14 Jun 2004 13:07:29 -0700 (PDT) Date: Mon, 14 Jun 2004 13:07:29 -0700 (PDT) From: Stephan Szabo To: Tom Lane Cc: Jaime Casanova , pgsql-sql@postgresql.org Subject: Re: query with =ALL In-Reply-To: <5688.1087242100@sss.pgh.pa.us> Message-ID: <20040614125225.J51553@megazone.bigpanda.com> References: <5688.1087242100@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/128 X-Sequence-Number: 18073 On Mon, 14 Jun 2004, Tom Lane wrote: > "Jaime Casanova" writes: > > AND > > CPA.cur_paralelo = ALL (SELECT cur_paralelo FROM aca_t_curso ...) > > Wait a second ... we are all overthinking the problem. The subselect > returns three *different* values. It is not possible for any > CPA.cur_paralelo values to be simultaneously equal to all three. > So this test certainly fails at every row of CPA. > > Perhaps you meant "= ANY"? I think what he wants is to output distinct sets of output columns where for each of these sets of output columns there exists a set of rows that meet the other conditions and that the set of cur_paralelo values for that set of rows is the same as (or perhaps is a superset of) the set of values returned from the subselect.