Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by hub.org (8.10.1/8.11.0) with ESMTP id e9OM79N31211 for ; Tue, 24 Oct 2000 18:07:11 -0400 (EDT) (envelope-from josh@agliodbs.com) Received: from [206.169.43.130] (HELO agliodbs.com) by davinci.ethosmedia.com (CommuniGate Pro SMTP 3.3) with ESMTP id 1112327 for pgsql-sql@postgresql.org; Tue, 24 Oct 2000 15:07:08 -0700 Message-ID: <39F607F1.46CA4E47@agliodbs.com> Date: Tue, 24 Oct 2000 15:06:41 -0700 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions X-Mailer: Mozilla 4.73 [en] (Win98; I) X-Accept-Language: en MIME-Version: 1.0 To: sqllist Subject: Re: Help on Union Query References: <20001025044450.A6123@s2.enthdimension.com.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200010/215 X-Sequence-Number: 1877 Mr. May, The reason you're having trouble is that the problem you've described does not call for a union query at all. What you want is a simple GROUP BY query: SELECT Node_ID, Word, Count(*) FROM NodeIndex GROUP BY Node_ID, Word -Josh Berkus -- ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 436-9166 for law firms, small businesses fax 436-0137 and non-profit organizations. pager 338-4078 San Francisco