Search Postgresql Archives

Problems with select statement

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

 



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



---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@xxxxxxxxxxxxxx

[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