Cross joining table with itself

Поиск
Список
Период
Сортировка
От Bob Hutzel
Тема Cross joining table with itself
Дата
Msg-id pan.2003.09.21.14.33.57.361582@myrealbox.com
обсуждение исходный текст
Ответы Re: Cross joining table with itself
Список 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 по дате отправления:

Предыдущее
От: Kevin Houle
Дата:
Сообщение: Re: Unique Constraint Based on Date Range
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Cross joining table with itself