Cross joining table with itself - Mailing list pgsql-sql

From Bob Hutzel
Subject Cross joining table with itself
Date
Msg-id pan.2003.09.21.14.33.57.361582@myrealbox.com
Whole thread Raw
Responses Re: Cross joining table with itself  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-sql
I've been stumped trying to solve this problem via SQL. I have a table ID,
member1, member2, member3. In any row, any member field may have a value
or be null. I want to tally up how many times each member appears in the
table as a whole. For example, if two entries were ('a', '', 'c') and
('b', 'c', ''), I'd like my final result to be:

a, 1
b, 1
c, 2

Is this feasible? Thank you for any help.



pgsql-sql by date:

Previous
From: Kevin Houle
Date:
Subject: Re: Unique Constraint Based on Date Range
Next
From: Bruno Wolff III
Date:
Subject: Re: Cross joining table with itself