Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query help

Status
Not open for further replies.

phunkyb

Technical User
Dec 30, 2003
14
0
0
AU
hello
can someone help me with this query. I want to get the averages of a football team's average kicks handballs and marks and group it by the away team. I am able to get the averages of a team as a whole but am stuck on the away team. I have two tables the game and stats. The game is as follow
GAME

gameid
date
home
away
venueid
round
time

and

STATS

gameid
teamid
kicks
handballs
marks

What do i have to do to link the teamid from stats to the away in game. Everything i have tried has been unsuccessful.
Thanks for your help
 
First of all, the entire GAME table is irrelevant. Since each game can have different teams, it doesn't matter which games they played in.

You should just iterate through all of the STATS for a given teamid, cumulatively adding the kicks, handballs and marks. After that, divide the totals by the number of matching rows in STATS.

What coding language are you using?

[sub]I REALLY hope that helps.[/sub]
Will
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top