Received: from mx99.openu.ac.il (arbel.openu.ac.il [147.233.32.4]) by hub.org (8.9.3/8.9.3) with ESMTP id GAA32989 for ; Wed, 16 Jun 1999 06:31:25 -0400 (EDT) (envelope-from herouth@oumail.openu.ac.il) Received: from talmon.openu.ac.il (talmon.openu.ac.il [147.233.32.11]) by mx99.openu.ac.il (Postfix) with ESMTP for id F302E4B622; Wed, 16 Jun 1999 13:31:22 +0300 (IDT) Received: from [147.233.159.109] (mac-herouth.pc.openu.ac.il) by talmon.openu.ac.il (Netscape Messaging Server 3.54) with ESMTP id AAA5E10; Wed, 16 Jun 1999 13:34:05 +0300 X-Sender: herouth@shaked.cc.openu.ac.il Message-Id: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Wed, 16 Jun 1999 13:32:31 +0300 To: pgsql-sql@postgreSQL.org, matthew@venux.net From: Herouth Maoz Subject: Re: [SQL] DISTINCT count(*), possible? At 11:55 +0300 on 16/06/1999, Stuart Rison wrote: > A previously posted work-around (search the GENERAL mailing list with > 'count', 'DISTINCT' and 'Herouth') adapted to your query is: > > SELECT count(*) > FROM aro t1 > WHERE int( oid ) = ( > SELECT min( int( t2.oid ) ) > FROM test t2 > WHERE t2.address1 = t1.address1 > ); Since I apparently own the copyright for this solution :-) The internal FROM should read "FROM aro t2", not "FROM test t2". Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma