Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id A5D4E2E174F for ; Wed, 14 Nov 2007 09:21:15 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 18666-05 for ; Wed, 14 Nov 2007 09:21:12 -0400 (AST) Received: from fhw-relay07.plus.net (fhw-relay07.plus.net [212.159.14.215]) by postgresql.org (Postfix) with ESMTP id 6F2002E0F8F for ; Wed, 14 Nov 2007 09:21:12 -0400 (AST) Received: from [84.51.143.99] (helo=server3.office.archonet.com) by fhw-relay07.plus.net with esmtp (Exim) id 1IsIB4-0007hh-MS; Wed, 14 Nov 2007 13:21:10 +0000 Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 8510F274063; Wed, 14 Nov 2007 13:21:10 +0000 (GMT) Message-ID: <473AF646.2010307@archonet.com> Date: Wed, 14 Nov 2007 13:21:10 +0000 From: Richard Huxton User-Agent: Thunderbird 2.0.0.6 (X11/20070728) MIME-Version: 1.0 To: Julien Cigar CC: pgsql-sql@postgresql.org Subject: Re: ALL() question References: <1195047542.3190.9.camel@frodon.be-bif.ulb.ac.be> <473AE27E.6050103@archonet.com> <1195051800.3190.18.camel@frodon.be-bif.ulb.ac.be> <1195052270.3190.21.camel@frodon.be-bif.ulb.ac.be> In-Reply-To: <1195052270.3190.21.camel@frodon.be-bif.ulb.ac.be> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/68 X-Sequence-Number: 29596 Julien Cigar wrote: > I finally found a solution: > > SELECT specimen_id > FROM specimen_test_bits > GROUP BY specimen_id > HAVING array_accum(test_bit_id) = '{2,3,4}'; > > .. but I don't think it's very "clean" .. The key question is whether you can rely on getting (2,3,4) or whether you might get (4,3,2) or some other ordering. -- Richard Huxton Archonet Ltd