Re: Help on Union Query - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Help on Union Query
Date
Msg-id 39F607F1.46CA4E47@agliodbs.com
Whole thread Raw
In response to Help on Union Query  (Craig May <craig.may@s2.enthdimension.com.au>)
List pgsql-sql
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
informationtechnology      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


pgsql-sql by date:

Previous
From: "Brian C. Doyle"
Date:
Subject: Re: Alternate Database Locations
Next
From: Tom Lane
Date:
Subject: Re: knowing which columns have beend UPDATEd inside a TRIGGER?