SELECT NULL as date, person_id, year_id, team_id, player_game_num_season, NULL as team_name_abbr, ts.link as team_name_abbr_link, NULL as opp_name_abbr, os.opp_team_link as opp_name_abbr_link, game_id, sup_games.link, NULL as game_location, (SELECT points-points_opp+ifnull(points,0)/100 FROM sup_team_games tg2 WHERE tg2.game_id=st.game_id AND tg2.team_id=st.team_id) as game_result_csk, concat(sum(win),'-',sum(loss),if(sum(tie),concat('-',sum(tie)),'')) as game_result, conf_id, NULL AS ranker, SUM(player_game_num_career IS NULL) as player_game_num_career_incomplete, NULL AS player_game_num_career, SUM(team_game_num_season IS NULL) as team_game_num_season_incomplete, NULL AS team_game_num_season, SUM(type IS NULL)+SUM(phase_id IS NULL)+SUM(tourn_id IS NULL) as game_type_incomplete, NULL AS game_type, SUM(pass_cmp IS NULL) as pass_cmp_incomplete, SUM(pass_cmp) AS pass_cmp, SUM(pass_att IS NULL) as pass_att_incomplete, SUM(pass_att) AS pass_att, IF(SUM(pass_att), SUM(pass_cmp)/SUM(pass_att), NULL) as pass_cmp_pct_csk, SUM(pass_cmp IS NULL)+SUM(pass_att IS NULL) as pass_cmp_pct_incomplete, ROUND(100 * (IF(SUM(pass_att), SUM(pass_cmp)/SUM(pass_att), NULL)),1) AS pass_cmp_pct, SUM(pass_yds IS NULL) as pass_yds_incomplete, SUM(pass_yds) AS pass_yds, SUM(pass_td IS NULL) as pass_td_incomplete, SUM(pass_td) AS pass_td, SUM(pass_int IS NULL) as pass_int_incomplete, SUM(pass_int) AS pass_int, IF(SUM(pass_att), (SUM(pass_yds)/SUM(pass_att)), NULL) as pass_yds_per_att_csk, SUM(pass_att IS NULL)+SUM(pass_yds IS NULL) as pass_yds_per_att_incomplete, ROUND(IF(SUM(pass_att), (SUM(pass_yds)/SUM(pass_att)), NULL),1) AS pass_yds_per_att, IF(SUM(pass_att),(SUM(pass_yds) + 20.0 * SUM(pass_td) - 45.0 * SUM(pass_int))/SUM(pass_att),NULL) as pass_adj_yds_per_att_csk, SUM(pass_int IS NULL)+SUM(pass_td IS NULL)+SUM(pass_att IS NULL)+SUM(pass_yds IS NULL) as pass_adj_yds_per_att_incomplete, ROUND(IF(SUM(pass_att),(SUM(pass_yds) + 20.0 * SUM(pass_td) - 45.0 * SUM(pass_int))/SUM(pass_att),NULL),2) AS pass_adj_yds_per_att, IF(SUM(pass_att) > 0, (8.4 * SUM(pass_yds) + 330 * SUM(pass_td) - 200 * SUM(pass_int) + 100 * SUM(pass_cmp)) / SUM(pass_att), NULL) as pass_rating_csk, SUM(pass_att IS NULL)+SUM(pass_yds IS NULL)+SUM(pass_int IS NULL)+SUM(pass_td IS NULL)+SUM(pass_cmp IS NULL) as pass_rating_incomplete, ROUND(IF(SUM(pass_att) > 0, (8.4 * SUM(pass_yds) + 330 * SUM(pass_td) - 200 * SUM(pass_int) + 100 * SUM(pass_cmp)) / SUM(pass_att), NULL),1) AS pass_rating, SUM(rush_att IS NULL) as rush_att_incomplete, SUM(rush_att) AS rush_att, SUM(rush_yds IS NULL) as rush_yds_incomplete, sum(rush_yds) AS rush_yds, IF(SUM(rush_att), SUM(rush_yds)/SUM(rush_att), NULL) as rush_yds_per_att_csk, SUM(rush_yds IS NULL)+SUM(rush_att IS NULL) as rush_yds_per_att_incomplete, ROUND(IF(SUM(rush_att), SUM(rush_yds)/SUM(rush_att), NULL),1) AS rush_yds_per_att, SUM(rush_td IS NULL) as rush_td_incomplete, SUM(rush_td) AS rush_td, SUM(is_bowl_game IS NULL) as bowl_name_incomplete, NULL AS bowl_name FROM sup_player_games as st JOIN sup_games USING (game_id) JOIN sup_people USING (person_id) JOIN sup_players USING (person_id) JOIN (SELECT game_id, year_id, comp_id, phase_id, part_id, team_id, opp_team_id, opp_comp_id, opp_phase_id, team_game_num_season, home_away_neutral, win, loss, tie FROM sup_team_games ) as tg USING (game_id, team_id) JOIN sup_phase_seasons USING (comp_id, phase_id, year_id) JOIN sup_comp_seasons USING (comp_id, year_id) JOIN (SELECT team_id, year_id, name_short, name, link FROM sup_team_seasons GROUP BY team_id, year_id ) as ts USING (team_id, year_id) LEFT JOIN (SELECT team_id as opp_team_id, link as opp_team_link, year_id, name_abbr, name_short FROM sup_team_seasons GROUP BY team_id, year_id ) as os USING (opp_team_id, year_id) JOIN (SELECT team_id, comp_id, year_id, phase_id, name_short, conf_id, link FROM sup_team_seasons ) as sts USING (team_id, comp_id, year_id, phase_id) LEFT JOIN (SELECT parent_conf_id, conf_id, conf_name, conf_abbr, link as conf_abbr_link, comp_id, year_id FROM sup_conference_seasons ) as team_conf USING (conf_id, comp_id, year_id) WHERE person_id = ? AND year_id = ? GROUP BY person_id ORDER BY `date` asc