Last one, I promise. How do I take this code:
SELECT season, away_team_id,
COUNT(IF(AwayRsn='WHit',1,NULL)) AS AwayWHit,
COUNT(IF(AwayRsn='LHit',1,NULL)) AS AwayLHit,
COUNT(IF(AwayRsn='WPit',1,NULL)) AS AwayWPit,
COUNT(IF(AwayRsn='LPit',1,NULL)) AS AwayLPit,
COUNT(IF(AwayRsn='WBoth',1,NULL)) AS AwayWBoth,
COUNT(IF(AwayRsn='LBoth',1,NULL)) AS AwayLBoth
FROM games
GROUP BY season, away_team_id
Which gives me the results I need and change it from just an output to actually going into the teams table in the proper column? I need to join the data based on both season and away_team_id