Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL and Group by

582588Aug 27 2008 — edited Aug 27 2008
Hi all,

I have a query
SELECT schedule_id ,COLUMN_VALUE,player_team_coach,current_player_team_id
FROM stat_totals where SCHEDULE_ID = '20040809NFL--WASHINGTON0' AND COLUMN_ID ='FPLKICK_PR_YARD';

this returns me
schedule_id column_value player_team_coach team_id
20040809NFL--WASHINGTON0 11 13373 8831
20040809NFL--WASHINGTON0 15 1953480 8831
20040809NFL--WASHINGTON0 46 2026423 8810

for a given schedule there are only two teams playing.whenever team_id = 8831, i need 8810 column_values which is equal to 46
and whenever team_id = 8810 , i have to sum up all the column_values of 8831 which is 11+ 15=26 .
My output must look like the one below.
schedule_id sum( column_value) player_team_coach
8831 46 13373
8831 46 1953480
8810 26 2026423
This post has been answered by Satyaki_De on Aug 27 2008
Jump to Answer

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 24 2008
Added on Aug 27 2008
7 comments
226 views