Search Postgresql Archives

Re: aggregation question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9 December 2015 at 00:44, Chris Withers <chris@xxxxxxxxxxxxxxxx> wrote:
Hi All,

I hope this is quite a simple one...

I have a fixtures table containing home_club and away_club, and I'd like to select the distinct list of clubs contained in all rows but in either the home_club or away_club columns.

How would I do that?

Use UNION:

select home_club from fixtures UNION select away_club from fixtures; 

--
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux