Problems with select statement

Поиск
Список
Период
Сортировка
От phil campaigne
Тема Problems with select statement
Дата
Msg-id 4218E171.70605@charter.net
обсуждение исходный текст
Список pgsql-general
Hi all,
I'm haveing trouble writing a select statement that gives me a resulting
row like this:
player_number, player name,a,c,t, (total of a+c+t).

here's what I have so far but it puts the a,c,t in separate rows.

hardwoodthunder=# select (select player_points where aspect='A') as
A,(select player_points where aspect='C') as C, (select player_points
where aspect='T') as T, player_number, player_name
from (select * from player as a, teamshare as b where
a.player_number=b.player) as c;
  a   |  c   |  t  | player_number | player_name
------+------+-----+---------------+-------------
 0.27 |      |     | 42            | S. Randolph
      | 0.33 |     | 42            | S. Randolph
      |      | 0.8 | 42            | S. Randolph
 0.54 |      |     | 42            | S. Randolph
      | 0.66 |     | 42            | S. Randolph
      |      | 0.8 | 42            | S. Randolph
 0.27 |      |     | 40            | R. Perkins
      | 0.33 |     | 40            | R. Perkins
(8 rows)
Any ideas on how to consolidate the rows?
thanks in advance,
Phil Campagine


В списке pgsql-general по дате отправления:

Предыдущее
От: "Larry Rosenman"
Дата:
Сообщение: Re: Scalability with large numbers of tables
Следующее
От: Phil Endecott
Дата:
Сообщение: Re: Triggers, again.. ;-)