Mike Trout vs. Julio Urías: Head-to-Head Stats Comparison

Compare players and teams or see head to head results between teams, players, player vs. team, or batter vs. pitcher. • Tutorial VideoSample SearchesData Coverage
THIS QUESTION WAS ANSWERED USING
Stathead Baseball Logo POWERED BY Baseball Reference Logo
Your All Access Pass to the Baseball Database Go beyond the basics. Become a Stathead
Start Your FREE Trial
Display Query »
--------------------------------------

header_pvp_summary

WITH
  rsbvp AS (
SELECT person_id, SUM(PA) AS b_pa, SUM(H)/SUM(AB) as b_batting_avg_csk, TRIM(LEADING '0' FROM ROUND(SUM(H)/SUM(AB),3)) AS b_batting_avg, (SUM(H) + SUM(BB) + SUM(HBP)) / (SUM(AB) + SUM(BB) + SUM(HBP) + SUM(SF)) as b_onbase_perc_csk, TRIM(LEADING '0' FROM ROUND((SUM(H) + SUM(BB) + SUM(HBP)) / (SUM(AB) + SUM(BB) + SUM(HBP) + SUM(SF)),3)) AS b_onbase_perc, (SUM(H) + SUM(2B) + (SUM(3B)*2) + (SUM(HR)*3)) / SUM(AB) as b_slugging_perc_csk, TRIM(LEADING '0' FROM ROUND((SUM(H) + SUM(2B) + (SUM(3B)*2) + (SUM(HR)*3)) / SUM(AB),3)) AS b_slugging_perc, SUM(HR) AS b_hr, SUM(SO) AS b_so
FROM bvp as st
  JOIN (SELECT key_bbref, key_milb as batter_id FROM reg_xref) as b ON b.key_bbref=result_batter
  JOIN (SELECT key_bbref, key_milb as pitcher_id FROM reg_xref) as p ON p.key_bbref=result_pitcher
  JOIN sup_players ON batter_id=person_id
  JOIN sup_people USING (person_id)
WHERE (batter_id=? OR batter_id=?)
  AND IF(batter_id=?,pitcher_id=?,pitcher_id=?) 
GROUP BY result_pitcher 
  ),
  pobvp AS (
SELECT person_id, SUM(PA) AS b_pa, SUM(H)/SUM(AB) as b_batting_avg_csk, TRIM(LEADING '0' FROM ROUND(SUM(H)/SUM(AB),3)) AS b_batting_avg, (SUM(H) + SUM(BB) + SUM(HBP)) / (SUM(AB) + SUM(BB) + SUM(HBP) + SUM(SF)) as b_onbase_perc_csk, TRIM(LEADING '0' FROM ROUND((SUM(H) + SUM(BB) + SUM(HBP)) / (SUM(AB) + SUM(BB) + SUM(HBP) + SUM(SF)),3)) AS b_onbase_perc, (SUM(H) + SUM(2B) + (SUM(3B)*2) + (SUM(HR)*3)) / SUM(AB) as b_slugging_perc_csk, TRIM(LEADING '0' FROM ROUND((SUM(H) + SUM(2B) + (SUM(3B)*2) + (SUM(HR)*3)) / SUM(AB),3)) AS b_slugging_perc, SUM(HR) AS b_hr, SUM(SO) AS b_so
FROM bvp_post as st
  JOIN (SELECT key_bbref, key_milb as batter_id FROM reg_xref) as b ON b.key_bbref=result_batter
  JOIN (SELECT key_bbref, key_milb as pitcher_id FROM reg_xref) as p ON p.key_bbref=result_pitcher
  JOIN sup_players ON batter_id=person_id
  JOIN sup_people USING (person_id)
WHERE (batter_id=? OR batter_id=?)
  AND IF(batter_id=?,pitcher_id=?,pitcher_id=?) 
GROUP BY result_pitcher 
  )
SELECT rsbvp.person_id, rsbvp.b_pa AS rsbvp_b_pa, pobvp.b_pa AS pobvp_b_pa, rsbvp.b_batting_avg AS rsbvp_b_batting_avg, pobvp.b_batting_avg AS pobvp_b_batting_avg, rsbvp.b_onbase_perc AS rsbvp_b_onbase_perc, pobvp.b_onbase_perc AS pobvp_b_onbase_perc, rsbvp.b_slugging_perc AS rsbvp_b_slugging_perc, pobvp.b_slugging_perc AS pobvp_b_slugging_perc, rsbvp.b_hr AS rsbvp_b_hr, pobvp.b_hr AS pobvp_b_hr, rsbvp.b_so AS rsbvp_b_so, pobvp.b_so AS pobvp_b_so
FROM rsbvp
  LEFT JOIN pobvp USING (person_id)
WHERE 1  LIMIT 0, 200

SQL PARAMS -- $VAR1 = [
          'trout-001mik',
          'urias-000jul',
          'trout-001mik',
          'urias-000jul',
          'trout-001mik',
          'trout-001mik',
          'urias-000jul',
          'trout-001mik',
          'urias-000jul',
          'trout-001mik'
        ];

--------------------------------------

bvp_sum

Page Setup Time: 0.00147 seconds

SELECT year_game as event_year_id, "reg" as type, PA AS b_pa, AB AS b_ab, H AS b_h, 2B AS b_doubles, 3B AS b_triples, HR AS b_hr, RBI AS b_rbi, BB AS b_bb, SO AS b_so, H/AB as b_batting_avg_csk, TRIM(LEADING '0' FROM ROUND(H/AB,3)) AS b_batting_avg, (H + BB + HBP) / (AB + BB + HBP + SF) as b_onbase_perc_csk, TRIM(LEADING '0' FROM ROUND((H + BB + HBP) / (AB + BB + HBP + SF),3)) AS b_onbase_perc, (H + 2B + (3B*2) + (HR*3)) / AB as b_slugging_perc_csk, TRIM(LEADING '0' FROM ROUND((H + 2B + (3B*2) + (HR*3)) / AB,3)) AS b_slugging_perc, ((H + BB + HBP) / (AB + BB + HBP + SF)) + ((H + 2B + (3B*2) + (HR*3)) / AB) as b_onbase_plus_slugging_csk, TRIM(LEADING '0' FROM ROUND(((H + BB + HBP) / (AB + BB + HBP + SF)) + ((H + 2B + (3B*2) + (HR*3)) / AB),3)) AS b_onbase_plus_slugging, SH AS b_sh, SF AS b_sf, IBB AS b_ibb, HBP AS b_hbp, GIDP AS b_gidp
FROM bvp
  JOIN (SELECT key_bbref, key_milb as batter_id FROM reg_xref) as b ON b.key_bbref=result_batter
  JOIN (SELECT key_bbref, key_milb as pitcher_id FROM reg_xref) as p ON p.key_bbref=result_pitcher
WHERE ((batter_id=?) AND (pitcher_id=?)) 
ORDER BY year_game 

SQL PARAMS -- $VAR1 = [
          'trout-001mik',
          'urias-000jul'
        ];

Query Time: 0.00 seconds
SELECT year_game as event_year_id, "reg" as type, PA AS b_pa, AB AS b_ab, H AS b_h, 2B AS b_doubles, 3B AS b_triples, HR AS b_hr, RBI AS b_rbi, BB AS b_bb, SO AS b_so, H/AB as b_batting_avg_csk, TRIM(LEADING '0' FROM ROUND(H/AB,3)) AS b_batting_avg, (H + BB + HBP) / (AB + BB + HBP + SF) as b_onbase_perc_csk, TRIM(LEADING '0' FROM ROUND((H + BB + HBP) / (AB + BB + HBP + SF),3)) AS b_onbase_perc, (H + 2B + (3B*2) + (HR*3)) / AB as b_slugging_perc_csk, TRIM(LEADING '0' FROM ROUND((H + 2B + (3B*2) + (HR*3)) / AB,3)) AS b_slugging_perc, ((H + BB + HBP) / (AB + BB + HBP + SF)) + ((H + 2B + (3B*2) + (HR*3)) / AB) as b_onbase_plus_slugging_csk, TRIM(LEADING '0' FROM ROUND(((H + BB + HBP) / (AB + BB + HBP + SF)) + ((H + 2B + (3B*2) + (HR*3)) / AB),3)) AS b_onbase_plus_slugging, SH AS b_sh, SF AS b_sf, IBB AS b_ibb, HBP AS b_hbp, GIDP AS b_gidp
FROM bvp_post
  JOIN (SELECT key_bbref, key_milb as batter_id FROM reg_xref) as b ON b.key_bbref=result_batter
  JOIN (SELECT key_bbref, key_milb as pitcher_id FROM reg_xref) as p ON p.key_bbref=result_pitcher
WHERE ((batter_id=?) AND (pitcher_id=?)) 
ORDER BY year_game 

SQL PARAMS -- $VAR1 = [
          'trout-001mik',
          'urias-000jul'
        ];

Query Time: 0.00 seconds
Table Build Time: 0.04 seconds


--------------------------------------

bvp_pa

Page Setup Time: 0.00135 seconds

SELECT year_game as event_year_id, CONCAT(date_game,IF(date_game_number,CONCAT(" (",date_game_number,")"),"")) as date, (SELECT link FROM sup_games WHERE game_id=date_game_link) as game_link, batter_team_abbr as event_b_team, pitcher_team_abbr as event_p_team, date_game_link as game_id, event_num, team_rel_score, inning, CASE
  WHEN runners_on_bases=''    THEN '---'
  WHEN runners_on_bases='000' THEN '---'
  WHEN runners_on_bases='100' THEN '1--'
  WHEN runners_on_bases='010' THEN '-2-'
  WHEN runners_on_bases='001' THEN '--3'
  WHEN runners_on_bases='110' THEN '12-'
  WHEN runners_on_bases='011' THEN '-23'
  WHEN runners_on_bases='101' THEN '1-3'
  WHEN runners_on_bases='111' THEN '123'
  ELSE runners_on_bases
  END AS runners_on_bases, CONCAT('https://www.baseball-reference.com/tools/def.cgi?html=1&game-event=',date_game_link,'-',event_num) AS runners_on_bases_endpoint, outs, pitches as pitches_pbp_csk, IF(pitches, CONCAT(pitches, " (", ball_strike_count, ")"), "") AS pitches_pbp, CONCAT('https://www.baseball-reference.com/tools/pitch.cgi?html=1&game-event=',date_game_link,'-',event_num) AS pitches_pbp_endpoint, play_desc
FROM event_bat
  JOIN (SELECT key_bbref, key_milb as batter_id FROM reg_xref) as b ON b.key_bbref=result_batter
  JOIN (SELECT key_bbref, key_milb as pitcher_id FROM reg_xref) as p ON p.key_bbref=result_pitcher
  JOIN (SELECT team_id, year_id, name_abbr as batter_team_abbr, link as batter_team_link FROM sup_team_seasons WHERE phase_id="reg"  ) as bt ON bt.team_id=team_franch AND bt.year_id=year_game
  JOIN (SELECT team_id, year_id, name_abbr as pitcher_team_abbr, link as pitcher_team_link FROM sup_team_seasons WHERE phase_id="reg"  ) as pt ON pt.team_id=opp_franch AND pt.year_id=year_game
WHERE ((batter_id=?) AND (pitcher_id=?))  LIMIT 0, 20

SQL PARAMS -- $VAR1 = [
          'trout-001mik',
          'urias-000jul'
        ];

Query Time: 0.01 seconds
SELECT year_game as event_year_id, CONCAT(date_game,IF(date_game_number,CONCAT(" (",date_game_number,")"),"")) as date, (SELECT link FROM sup_games WHERE game_id=date_game_link) as game_link, batter_team_abbr as event_b_team, pitcher_team_abbr as event_p_team, date_game_link as game_id, event_num, team_rel_score, inning, CASE
  WHEN runners_on_bases=''    THEN '---'
  WHEN runners_on_bases='000' THEN '---'
  WHEN runners_on_bases='100' THEN '1--'
  WHEN runners_on_bases='010' THEN '-2-'
  WHEN runners_on_bases='001' THEN '--3'
  WHEN runners_on_bases='110' THEN '12-'
  WHEN runners_on_bases='011' THEN '-23'
  WHEN runners_on_bases='101' THEN '1-3'
  WHEN runners_on_bases='111' THEN '123'
  ELSE runners_on_bases
  END AS runners_on_bases_post, CONCAT('https://www.baseball-reference.com/tools/def.cgi?html=1&game-event=',date_game_link,'-',event_num,'-post') AS runners_on_bases_post_endpoint, outs, pitches as pitches_pbp_post_csk, IF(pitches, CONCAT(pitches, " (", ball_strike_count, ")"), "") AS pitches_pbp_post, CONCAT('https://www.baseball-reference.com/tools/pitch.cgi?html=1&game-event=',date_game_link,'-',event_num,'-post') AS pitches_pbp_post_endpoint, play_desc
FROM event_bat_post
  JOIN (SELECT key_bbref, key_milb as batter_id FROM reg_xref) as b ON b.key_bbref=result_batter
  JOIN (SELECT key_bbref, key_milb as pitcher_id FROM reg_xref) as p ON p.key_bbref=result_pitcher
  JOIN (SELECT team_id, year_id, name_abbr as batter_team_abbr, link as batter_team_link FROM sup_team_seasons WHERE phase_id="reg"  ) as bt ON bt.team_id=team_franch AND bt.year_id=year_game
  JOIN (SELECT team_id, year_id, name_abbr as pitcher_team_abbr, link as pitcher_team_link FROM sup_team_seasons WHERE phase_id="reg"  ) as pt ON pt.team_id=opp_franch AND pt.year_id=year_game
WHERE ((batter_id=?) AND (pitcher_id=?))  LIMIT 0, 20

SQL PARAMS -- $VAR1 = [
          'trout-001mik',
          'urias-000jul'
        ];

Query Time: 0.00 seconds
Table Build Time: 0.04 seconds


--------------------------------------

bat_total

Page Setup Time: 0.00230 seconds

SELECT person_id, IF(MIN(age)=MAX(age), MIN(age), CONCAT(MIN(age), '-', MAX(age))) as age_range, MIN(year_id) as year_min, MAX(year_id) as year_max, NULL as b_games_incomplete, SUM(b_games) AS b_games, SUM(b_pa IS NULL) as b_pa_incomplete, SUM(b_pa) AS b_pa, SUM(b_ab IS NULL) as b_ab_incomplete, SUM(b_ab) AS b_ab, SUM(b_r IS NULL) as b_r_incomplete, SUM(b_r) AS b_r, SUM(b_h IS NULL) as b_h_incomplete, SUM(b_h) AS b_h, SUM(b_doubles IS NULL) as b_doubles_incomplete, SUM(b_doubles) AS b_doubles, SUM(b_triples IS NULL) as b_triples_incomplete, SUM(b_triples) AS b_triples, SUM(b_hr IS NULL) as b_hr_incomplete, SUM(b_hr) AS b_hr, SUM(b_rbi IS NULL) as b_rbi_incomplete, SUM(b_rbi) AS b_rbi, SUM(b_sb IS NULL) as b_sb_incomplete, SUM(b_sb) AS b_sb, SUM(b_cs IS NULL) as b_cs_incomplete, SUM(b_cs) AS b_cs, SUM(b_bb IS NULL) as b_bb_incomplete, SUM(b_bb) AS b_bb, SUM(b_so IS NULL) as b_so_incomplete, SUM(b_so) AS b_so, IF(SUM(b_ab), SUM(b_h) / SUM(b_ab), NULL) as b_batting_avg_csk, SUM(b_h IS NULL)+SUM(b_ab IS NULL) as b_batting_avg_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab), SUM(b_h) / SUM(b_ab), NULL),3)) AS b_batting_avg, IF(SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL) as b_onbase_perc_csk, 0 as b_onbase_perc_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL),3)) AS b_onbase_perc, IF(SUM(b_ab), SUM(b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab), NULL) as b_slugging_perc_csk, SUM(b_triples IS NULL)+SUM(b_h IS NULL)+SUM(b_doubles IS NULL)+SUM(b_ab IS NULL)+SUM(b_hr IS NULL) as b_slugging_perc_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab), SUM(b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab), NULL),3)) AS b_slugging_perc, IF(SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL) + IF(SUM(b_ab), SUM(b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab), NULL) as b_onbase_plus_slugging_csk, 0 as b_onbase_plus_slugging_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL) + IF(SUM(b_ab), SUM(b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab), NULL),3)) AS b_onbase_plus_slugging, IF(sum(b_tob_lg_avg) = 0 || sum(b_tb_lg_avg) = 0, NULL, 100*((SUM(b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / sum(b_tb_lg_avg)) + (SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0))/sum(b_tob_lg_avg)) - 1)) as b_onbase_plus_slugging_plus_csk, 0 as b_onbase_plus_slugging_plus_incomplete, ROUND(IF(sum(b_tob_lg_avg) = 0 || sum(b_tb_lg_avg) = 0, NULL, 100*((SUM(b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / sum(b_tb_lg_avg)) + (SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0))/sum(b_tob_lg_avg)) - 1)),0) AS b_onbase_plus_slugging_plus, SUM(b_tb IS NULL) as b_tb_incomplete, SUM(b_tb) AS b_tb, SUM(b_gidp IS NULL) as b_gidp_incomplete, SUM(b_gidp) AS b_gidp, SUM(b_hbp IS NULL) as b_hbp_incomplete, SUM(b_hbp) AS b_hbp, SUM(b_sh IS NULL) as b_sh_incomplete, SUM(b_sh) AS b_sh, SUM(b_sf IS NULL) as b_sf_incomplete, SUM(b_sf) AS b_sf, SUM(b_ibb IS NULL) as b_ibb_incomplete, SUM(b_ibb) AS b_ibb
FROM sup_player_team_seasons as st
  JOIN sup_people USING (person_id)
  JOIN sup_players USING (person_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN sup_comp_seasons USING (comp_id, year_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="reg" 
GROUP BY person_id
ORDER BY person_id 

SQL PARAMS -- $VAR1 = [
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.00 seconds
SELECT person_id, IF(MIN(age)=MAX(age), MIN(age), CONCAT(MIN(age), '-', MAX(age))) as age_range, MIN(year_id) as year_min, MAX(year_id) as year_max, NULL as b_games_incomplete, SUM(b_games) AS b_games, SUM(b_pa IS NULL) as b_pa_incomplete, SUM(b_pa) AS b_pa, SUM(b_ab IS NULL) as b_ab_incomplete, SUM(b_ab) AS b_ab, SUM(b_r IS NULL) as b_r_incomplete, SUM(b_r) AS b_r, SUM(b_h IS NULL) as b_h_incomplete, SUM(b_h) AS b_h, SUM(b_doubles IS NULL) as b_doubles_incomplete, SUM(b_doubles) AS b_doubles, SUM(b_triples IS NULL) as b_triples_incomplete, SUM(b_triples) AS b_triples, SUM(b_hr IS NULL) as b_hr_incomplete, SUM(b_hr) AS b_hr, SUM(b_rbi IS NULL) as b_rbi_incomplete, SUM(b_rbi) AS b_rbi, SUM(b_sb IS NULL) as b_sb_incomplete, SUM(b_sb) AS b_sb, SUM(b_cs IS NULL) as b_cs_incomplete, SUM(b_cs) AS b_cs, SUM(b_bb IS NULL) as b_bb_incomplete, SUM(b_bb) AS b_bb, SUM(b_so IS NULL) as b_so_incomplete, SUM(b_so) AS b_so, IF(SUM(b_ab), SUM(b_h) / SUM(b_ab), NULL) as b_batting_avg_csk, SUM(b_h IS NULL)+SUM(b_ab IS NULL) as b_batting_avg_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab), SUM(b_h) / SUM(b_ab), NULL),3)) AS b_batting_avg, IF(SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL) as b_onbase_perc_csk, 0 as b_onbase_perc_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL),3)) AS b_onbase_perc, IF(SUM(b_ab), SUM(b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab), NULL) as b_slugging_perc_csk, SUM(b_triples IS NULL)+SUM(b_h IS NULL)+SUM(b_doubles IS NULL)+SUM(b_ab IS NULL)+SUM(b_hr IS NULL) as b_slugging_perc_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab), SUM(b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab), NULL),3)) AS b_slugging_perc, IF(SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL) + IF(SUM(b_ab), SUM(b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab), NULL) as b_onbase_plus_slugging_csk, 0 as b_onbase_plus_slugging_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL) + IF(SUM(b_ab), SUM(b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab), NULL),3)) AS b_onbase_plus_slugging, SUM(b_tb IS NULL) as b_tb_incomplete, SUM(b_tb) AS b_tb, SUM(b_gidp IS NULL) as b_gidp_incomplete, SUM(b_gidp) AS b_gidp, SUM(b_hbp IS NULL) as b_hbp_incomplete, SUM(b_hbp) AS b_hbp, SUM(b_sh IS NULL) as b_sh_incomplete, SUM(b_sh) AS b_sh, SUM(b_sf IS NULL) as b_sf_incomplete, SUM(b_sf) AS b_sf, SUM(b_ibb IS NULL) as b_ibb_incomplete, SUM(b_ibb) AS b_ibb
FROM sup_player_team_seasons as st
  JOIN sup_people USING (person_id)
  JOIN sup_players USING (person_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN sup_comp_seasons USING (comp_id, year_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="post" 
GROUP BY person_id
ORDER BY person_id 

SQL PARAMS -- $VAR1 = [
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.00 seconds
Table Build Time: 0.04 seconds

Table Build Time: 0.04 seconds


--------------------------------------

bat_value

Page Setup Time: 0.00082 seconds

SELECT person_id, IF(MIN(age)=MAX(age), MIN(age), CONCAT(MIN(age), '-', MAX(age))) as age_range, MIN(year_id) as year_min, MAX(year_id) as year_max, NULL as b_games_incomplete, SUM(b_games) AS b_games, SUM(b_pa IS NULL) as b_pa_incomplete, SUM(b_pa) AS b_pa, SUM(b_war) as b_war_csk, SUM(b_war IS NULL) as b_war_incomplete, ROUND(SUM(b_war),1) AS b_war, SUM(b_waa) as b_waa_csk, SUM(b_waa IS NULL) as b_waa_incomplete, ROUND(SUM(b_waa),1) AS b_waa, SUM(b_war_off) as b_war_off_csk, SUM(b_war_off IS NULL) as b_war_off_incomplete, ROUND(SUM(b_war_off),1) AS b_war_off, SUM(b_war_def) as b_war_def_csk, SUM(b_war_def IS NULL) as b_war_def_incomplete, ROUND(SUM(b_war_def),1) AS b_war_def, SUM(b_runs_batting) as b_runs_batting_csk, SUM(b_runs_batting IS NULL) as b_runs_batting_incomplete, ROUND(SUM(b_runs_batting),0) AS b_runs_batting, SUM(b_runs_double_plays) as b_runs_double_plays_csk, SUM(b_runs_double_plays IS NULL) as b_runs_double_plays_incomplete, ROUND(SUM(b_runs_double_plays),0) AS b_runs_double_plays, SUM(b_runs_baserunning) as b_runs_baserunning_csk, SUM(b_runs_baserunning IS NULL) as b_runs_baserunning_incomplete, ROUND(SUM(b_runs_baserunning),0) AS b_runs_baserunning, SUM(b_runs_fielding) as b_runs_fielding_csk, SUM(b_runs_fielding IS NULL) as b_runs_fielding_incomplete, ROUND(SUM(b_runs_fielding),0) AS b_runs_fielding
FROM sup_player_team_seasons as st
  JOIN sup_people USING (person_id)
  JOIN sup_players USING (person_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN sup_comp_seasons USING (comp_id, year_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="reg" 
GROUP BY person_id
ORDER BY person_id 

SQL PARAMS -- $VAR1 = [
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.00 seconds
Table Build Time: 0.04 seconds


--------------------------------------

bat_saber

Page Setup Time: 0.00176 seconds

SELECT person_id, IF(MIN(age)=MAX(age), MIN(age), CONCAT(MIN(age), '-', MAX(age))) as age_range, MIN(year_id) as year_min, MAX(year_id) as year_max, NULL as b_games_incomplete, SUM(b_games) AS b_games, SUM(b_pa IS NULL) as b_pa_incomplete, SUM(b_pa) AS b_pa, SUM(b_hr IS NULL)+SUM(b_triples IS NULL)+SUM(b_doubles IS NULL) as b_xbh_incomplete, SUM(b_doubles + b_triples + b_hr) AS b_xbh, SUM(b_bb IS NULL)+SUM(b_hbp IS NULL)+SUM(b_h IS NULL) as b_tob_incomplete, SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) AS b_tob, SUM(b_h IS NULL)+SUM(b_hbp IS NULL)+SUM(b_roe IS NULL)+SUM(b_bb IS NULL) as b_tob_with_roe_incomplete, SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_roe,0)) AS b_tob_with_roe, SUM(b_outs IS NULL) as b_outs_incomplete, SUM(b_outs) AS b_outs, SUM(b_runs_created IS NULL) as b_runs_created_incomplete, SUM(b_runs_created) AS b_runs_created, IF(SUM(b_ab-b_hr-IFNULL(b_so,0)+IFNULL(b_sf,0)) = 0, NULL, SUM(b_h-b_hr)/SUM(b_ab-b_hr-IFNULL(b_so,0)+IFNULL(b_sf,0))) as b_batting_avg_bip_csk, SUM(b_h IS NULL)+SUM(b_hr IS NULL)+SUM(b_sf IS NULL)+SUM(b_so IS NULL)+SUM(b_ab IS NULL) as b_batting_avg_bip_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab-b_hr-IFNULL(b_so,0)+IFNULL(b_sf,0)) = 0, NULL, SUM(b_h-b_hr)/SUM(b_ab-b_hr-IFNULL(b_so,0)+IFNULL(b_sf,0))),3)) AS b_batting_avg_bip, SUM(b_r IS NULL)+SUM(b_rbi IS NULL)+SUM(b_hr IS NULL) as b_runs_produced_incomplete, SUM(b_rbi + b_r - b_hr) AS b_runs_produced, SUM(b_adjusted_batting_runs IS NULL) as b_adjusted_batting_runs_incomplete, SUM(b_adjusted_batting_runs) AS b_adjusted_batting_runs, SUM(b_batting_wins) as b_batting_wins_csk, SUM(b_batting_wins IS NULL) as b_batting_wins_incomplete, ROUND(SUM(b_batting_wins),1) AS b_batting_wins, IF(SUM(b_ab) = 0, NULL, SUM(b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab)) as b_iso_slugging_csk, SUM(b_ab IS NULL)+SUM(b_hr IS NULL)+SUM(b_triples IS NULL)+SUM(b_doubles IS NULL) as b_iso_slugging_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab) = 0, NULL, SUM(b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab)),3)) AS b_iso_slugging, IF(SUM(b_so)=0 OR SUM(b_so) IS NULL, NULL, SUM(b_ab) / SUM(b_so)) as b_at_bats_per_strikeout_csk, SUM(b_so IS NULL)+SUM(b_ab IS NULL) as b_at_bats_per_strikeout_incomplete, ROUND(IF(SUM(b_so)=0 OR SUM(b_so) IS NULL, NULL, SUM(b_ab) / SUM(b_so)),1) AS b_at_bats_per_strikeout, IF( SUM( IF( b_cs IS NOT NULL, b_cs + b_sb, 0 ) ) = 0, NULL, SUM( IF( b_cs IS NOT NULL, b_sb, 0 ) ) / SUM( IF( b_cs IS NOT NULL, b_cs + b_sb, 0 ) ) ) as b_stolen_base_perc_csk, SUM(b_cs IS NULL)+SUM(b_sb IS NULL) as b_stolen_base_perc_incomplete, ROUND(100 * (IF( SUM( IF( b_cs IS NOT NULL, b_cs + b_sb, 0 ) ) = 0, NULL, SUM( IF( b_cs IS NOT NULL, b_sb, 0 ) ) / SUM( IF( b_cs IS NOT NULL, b_cs + b_sb, 0 ) ) )),1) AS b_stolen_base_perc, SUM(b_cs IS NULL)+SUM(b_sb IS NULL) as b_sb_attempts_incomplete, SUM(b_sb + b_cs) AS b_sb_attempts
FROM sup_player_team_seasons as st
  JOIN sup_people USING (person_id)
  JOIN sup_players USING (person_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN sup_comp_seasons USING (comp_id, year_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="reg" 
GROUP BY person_id
ORDER BY person_id 

SQL PARAMS -- $VAR1 = [
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.00 seconds
SELECT person_id, IF(MIN(age)=MAX(age), MIN(age), CONCAT(MIN(age), '-', MAX(age))) as age_range, MIN(year_id) as year_min, MAX(year_id) as year_max, NULL as b_games_incomplete, SUM(b_games) AS b_games, SUM(b_pa IS NULL) as b_pa_incomplete, SUM(b_pa) AS b_pa, SUM(b_hr IS NULL)+SUM(b_triples IS NULL)+SUM(b_doubles IS NULL) as b_xbh_incomplete, SUM(b_doubles + b_triples + b_hr) AS b_xbh, SUM(b_bb IS NULL)+SUM(b_hbp IS NULL)+SUM(b_h IS NULL) as b_tob_incomplete, SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) AS b_tob, SUM(b_h IS NULL)+SUM(b_hbp IS NULL)+SUM(b_roe IS NULL)+SUM(b_bb IS NULL) as b_tob_with_roe_incomplete, SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_roe,0)) AS b_tob_with_roe, SUM(b_outs IS NULL) as b_outs_incomplete, SUM(b_outs) AS b_outs, SUM(b_runs_created IS NULL) as b_runs_created_incomplete, SUM(b_runs_created) AS b_runs_created, IF(SUM(b_ab-b_hr-IFNULL(b_so,0)+IFNULL(b_sf,0)) = 0, NULL, SUM(b_h-b_hr)/SUM(b_ab-b_hr-IFNULL(b_so,0)+IFNULL(b_sf,0))) as b_batting_avg_bip_csk, SUM(b_h IS NULL)+SUM(b_hr IS NULL)+SUM(b_sf IS NULL)+SUM(b_so IS NULL)+SUM(b_ab IS NULL) as b_batting_avg_bip_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab-b_hr-IFNULL(b_so,0)+IFNULL(b_sf,0)) = 0, NULL, SUM(b_h-b_hr)/SUM(b_ab-b_hr-IFNULL(b_so,0)+IFNULL(b_sf,0))),3)) AS b_batting_avg_bip, SUM(b_r IS NULL)+SUM(b_rbi IS NULL)+SUM(b_hr IS NULL) as b_runs_produced_incomplete, SUM(b_rbi + b_r - b_hr) AS b_runs_produced, SUM(b_adjusted_batting_runs IS NULL) as b_adjusted_batting_runs_incomplete, SUM(b_adjusted_batting_runs) AS b_adjusted_batting_runs, SUM(b_batting_wins) as b_batting_wins_csk, SUM(b_batting_wins IS NULL) as b_batting_wins_incomplete, ROUND(SUM(b_batting_wins),1) AS b_batting_wins, IF(SUM(b_ab) = 0, NULL, SUM(b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab)) as b_iso_slugging_csk, SUM(b_ab IS NULL)+SUM(b_hr IS NULL)+SUM(b_triples IS NULL)+SUM(b_doubles IS NULL) as b_iso_slugging_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab) = 0, NULL, SUM(b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab)),3)) AS b_iso_slugging, IF(SUM(b_so)=0 OR SUM(b_so) IS NULL, NULL, SUM(b_ab) / SUM(b_so)) as b_at_bats_per_strikeout_csk, SUM(b_so IS NULL)+SUM(b_ab IS NULL) as b_at_bats_per_strikeout_incomplete, ROUND(IF(SUM(b_so)=0 OR SUM(b_so) IS NULL, NULL, SUM(b_ab) / SUM(b_so)),1) AS b_at_bats_per_strikeout, IF( SUM( IF( b_cs IS NOT NULL, b_cs + b_sb, 0 ) ) = 0, NULL, SUM( IF( b_cs IS NOT NULL, b_sb, 0 ) ) / SUM( IF( b_cs IS NOT NULL, b_cs + b_sb, 0 ) ) ) as b_stolen_base_perc_csk, SUM(b_cs IS NULL)+SUM(b_sb IS NULL) as b_stolen_base_perc_incomplete, ROUND(100 * (IF( SUM( IF( b_cs IS NOT NULL, b_cs + b_sb, 0 ) ) = 0, NULL, SUM( IF( b_cs IS NOT NULL, b_sb, 0 ) ) / SUM( IF( b_cs IS NOT NULL, b_cs + b_sb, 0 ) ) )),1) AS b_stolen_base_perc, SUM(b_cs IS NULL)+SUM(b_sb IS NULL) as b_sb_attempts_incomplete, SUM(b_sb + b_cs) AS b_sb_attempts
FROM sup_player_team_seasons as st
  JOIN sup_people USING (person_id)
  JOIN sup_players USING (person_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN sup_comp_seasons USING (comp_id, year_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="post" 
GROUP BY person_id
ORDER BY person_id 

SQL PARAMS -- $VAR1 = [
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.00 seconds
Table Build Time: 0.04 seconds

Table Build Time: 0.04 seconds


--------------------------------------

bat_win_prob

Page Setup Time: 0.00067 seconds

SELECT person_id, IF(MIN(age)=MAX(age), MIN(age), CONCAT(MIN(age), '-', MAX(age))) as age_range, MIN(year_id) as year_min, MAX(year_id) as year_max, NULL as b_games_incomplete, SUM(b_games) AS b_games, SUM(b_pa IS NULL) as b_pa_incomplete, SUM(b_pa) AS b_pa, SUM(b_wpa_bat) as b_wpa_bat_csk, SUM(b_wpa_bat IS NULL) as b_wpa_bat_incomplete, ROUND(SUM(b_wpa_bat),1) AS b_wpa_bat, SUM(b_wpa_li_adjusted) as b_wpa_li_adjusted_csk, SUM(b_wpa_li_adjusted IS NULL) as b_wpa_li_adjusted_incomplete, ROUND(SUM(b_wpa_li_adjusted),1) AS b_wpa_li_adjusted, SUM(b_wpa_bat)/(SUM(b_wpa_plays*b_leverage_index_avg)/SUM(b_wpa_plays)) - SUM(b_wpa_li_adjusted) as b_wpa_clutch_csk, SUM(b_wpa_plays IS NULL)+SUM(b_leverage_index_avg IS NULL)+SUM(b_wpa_li_adjusted IS NULL)+SUM(b_wpa_bat IS NULL) as b_wpa_clutch_incomplete, ROUND(SUM(b_wpa_bat)/(SUM(b_wpa_plays*b_leverage_index_avg)/SUM(b_wpa_plays)) - SUM(b_wpa_li_adjusted),1) AS b_wpa_clutch, SUM(b_baseout_runs) as b_baseout_runs_csk, SUM(b_baseout_runs IS NULL) as b_baseout_runs_incomplete, ROUND(SUM(b_baseout_runs),2) AS b_baseout_runs, SUM(b_baseout_wins) as b_baseout_wins_csk, SUM(b_baseout_wins IS NULL) as b_baseout_wins_incomplete, ROUND(SUM(b_baseout_wins),1) AS b_baseout_wins, SUM(b_re24_baseout_li) as b_re24_baseout_li_csk, SUM(b_re24_baseout_li IS NULL) as b_re24_baseout_li_incomplete, ROUND(SUM(b_re24_baseout_li),2) AS b_re24_baseout_li, SUM(b_wpa_plays*b_leverage_index_avg)/SUM(b_wpa_plays) as b_leverage_index_avg_csk, SUM(b_leverage_index_avg IS NULL)+SUM(b_wpa_plays IS NULL) as b_leverage_index_avg_incomplete, ROUND(SUM(b_wpa_plays*b_leverage_index_avg)/SUM(b_wpa_plays),2) AS b_leverage_index_avg
FROM sup_player_team_seasons as st
  JOIN sup_people USING (person_id)
  JOIN sup_players USING (person_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN sup_comp_seasons USING (comp_id, year_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="reg" 
GROUP BY person_id
ORDER BY person_id 

SQL PARAMS -- $VAR1 = [
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.00 seconds
Table Build Time: 0.03 seconds


--------------------------------------

pitch_tot

Page Setup Time: 0.00235 seconds

SELECT person_id, IF(MIN(age)=MAX(age), MIN(age), CONCAT(MIN(age), '-', MAX(age))) as age_range, MIN(year_id) as year_min, MAX(year_id) as year_max, SUM(p_w IS NULL) as p_w_incomplete, SUM(p_w) AS p_w, SUM(p_l IS NULL) as p_l_incomplete, SUM(p_l) AS p_l, IF(SUM(p_w + p_l), SUM(p_w) / SUM(p_w + p_l), NULL) as p_win_loss_perc_csk, SUM(p_l IS NULL)+SUM(p_w IS NULL) as p_win_loss_perc_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(p_w + p_l), SUM(p_w) / SUM(p_w + p_l), NULL),3)) AS p_win_loss_perc, IF(SUM(p_ip_outs), 27 * SUM(p_er) /SUM(p_ip_outs), IF(SUM(p_er), 1e20, NULL)) as p_earned_run_avg_csk, SUM(p_ip_outs IS NULL)+SUM(p_er IS NULL) as p_earned_run_avg_incomplete, ROUND(IF(SUM(p_ip_outs), 27 * SUM(p_er)/SUM(p_ip_outs), NULL),2) AS p_earned_run_avg, NULL as p_g_incomplete, SUM(p_g) AS p_g, SUM(p_gs IS NULL) as p_gs_incomplete, SUM(p_gs) AS p_gs, SUM(p_gf IS NULL) as p_gf_incomplete, SUM(p_gf) AS p_gf, SUM(p_cg IS NULL) as p_cg_incomplete, SUM(p_cg) AS p_cg, SUM(p_sho IS NULL) as p_sho_incomplete, SUM(p_sho) AS p_sho, SUM(p_sv IS NULL) as p_sv_incomplete, SUM(p_sv) AS p_sv, SUM(p_ip_outs) as p_ip_csk, SUM(p_ip_outs IS NULL) as p_ip_incomplete, SUM(p_ip_outs) DIV 3 + 0.1 * MOD(SUM(p_ip_outs),3) AS p_ip, SUM(p_h IS NULL) as p_h_incomplete, SUM(p_h) AS p_h, SUM(p_r IS NULL) as p_r_incomplete, SUM(p_r) AS p_r, SUM(p_er IS NULL) as p_er_incomplete, SUM(p_er) AS p_er, SUM(p_hr IS NULL) as p_hr_incomplete, SUM(p_hr) AS p_hr, SUM(p_bb IS NULL) as p_bb_incomplete, SUM(p_bb) AS p_bb, SUM(p_ibb IS NULL) as p_ibb_incomplete, SUM(p_ibb) AS p_ibb, SUM(p_so IS NULL) as p_so_incomplete, SUM(p_so) AS p_so, SUM(p_hbp IS NULL) as p_hbp_incomplete, SUM(p_hbp) AS p_hbp, SUM(p_bk IS NULL) as p_bk_incomplete, SUM(p_bk) AS p_bk, SUM(p_wp IS NULL) as p_wp_incomplete, SUM(p_wp) AS p_wp, SUM(p_bfp IS NULL) as p_bfp_incomplete, SUM(p_bfp) AS p_bfp, SUM(p_reached_on_strikeout IS NULL)+SUM(p_bb IS NULL)+SUM(p_roe IS NULL)+SUM(p_hbp IS NULL)+SUM(p_h IS NULL) as p_baserunners_incomplete, SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_roe,0) + IFNULL(p_reached_on_strikeout,0)) AS p_baserunners, IF(SUM(IFNULL(p_er,0)) = 0, NULL, 100*(SUM(p_er_lg_avg) / SUM(p_er))) as p_earned_run_avg_plus_csk, SUM(p_er IS NULL)+SUM(p_er_lg_avg IS NULL) as p_earned_run_avg_plus_incomplete, ROUND(IF(SUM(IFNULL(p_er,0)) = 0, NULL, 100*(SUM(p_er_lg_avg) / SUM(p_er))),0) AS p_earned_run_avg_plus, SUM(p_ip_outs*((39*p_hr + 9*(p_bb + IFNULL(p_hbp,0)) - 6 * p_so)/p_ip_outs  + fip_constant))/SUM(p_ip_outs) as p_fip_csk, SUM(p_hbp IS NULL)+SUM(fip_constant IS NULL)+SUM(p_ip_outs IS NULL)+SUM(p_bb IS NULL)+SUM(p_hr IS NULL)+SUM(p_so IS NULL) as p_fip_incomplete, ROUND(SUM(p_ip_outs*((39*p_hr + 9*(p_bb + IFNULL(p_hbp,0)) - 6 * p_so)/p_ip_outs  + fip_constant))/SUM(p_ip_outs),2) AS p_fip, IF(SUM(p_ip_outs) = 0, NULL, 3 * SUM(p_h + p_bb) / SUM(p_ip_outs)) as p_whip_csk, SUM(p_h IS NULL)+SUM(p_ip_outs IS NULL)+SUM(p_bb IS NULL) as p_whip_incomplete, ROUND(IF(SUM(p_ip_outs) = 0, NULL, 3 * SUM(p_h + p_bb) / SUM(p_ip_outs)),3) AS p_whip, IF(SUM(p_ip_outs) = 0, NULL, 27 * SUM(p_h) / SUM(p_ip_outs)) as p_hits_per_nine_csk, SUM(p_ip_outs IS NULL)+SUM(p_h IS NULL) as p_hits_per_nine_incomplete, ROUND(IF(SUM(p_ip_outs) = 0, NULL, 27 * SUM(p_h) / SUM(p_ip_outs)),1) AS p_hits_per_nine, IF(SUM(p_ip_outs) = 0, NULL, 27 * SUM(p_hr) / SUM(p_ip_outs)) as p_hr_per_nine_csk, SUM(p_ip_outs IS NULL)+SUM(p_hr IS NULL) as p_hr_per_nine_incomplete, ROUND(IF(SUM(p_ip_outs) = 0, NULL, 27 * SUM(p_hr) / SUM(p_ip_outs)),1) AS p_hr_per_nine, IF(SUM(p_ip_outs) = 0, NULL, 27 * SUM(p_bb) / SUM(p_ip_outs)) as p_bb_per_nine_csk, SUM(p_ip_outs IS NULL)+SUM(p_bb IS NULL) as p_bb_per_nine_incomplete, ROUND(IF(SUM(p_ip_outs) = 0, NULL, 27 * SUM(p_bb) / SUM(p_ip_outs)),1) AS p_bb_per_nine, IF(SUM(p_ip_outs) = 0, NULL, 27 * SUM(p_so) / SUM(p_ip_outs)) as p_so_per_nine_csk, SUM(p_ip_outs IS NULL)+SUM(p_so IS NULL) as p_so_per_nine_incomplete, ROUND(IF(SUM(p_ip_outs) = 0, NULL, 27 * SUM(p_so) / SUM(p_ip_outs)),1) AS p_so_per_nine
FROM sup_player_team_seasons as st
  JOIN sup_people USING (person_id)
  JOIN sup_players USING (person_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN sup_comp_seasons USING (comp_id, year_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="reg" 
GROUP BY person_id
HAVING p_g>0
ORDER BY person_id 

SQL PARAMS -- $VAR1 = [
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.00 seconds
SELECT person_id, IF(MIN(age)=MAX(age), MIN(age), CONCAT(MIN(age), '-', MAX(age))) as age_range, MIN(year_id) as year_min, MAX(year_id) as year_max, SUM(p_w IS NULL) as p_w_incomplete, SUM(p_w) AS p_w, SUM(p_l IS NULL) as p_l_incomplete, SUM(p_l) AS p_l, IF(SUM(p_w + p_l), SUM(p_w) / SUM(p_w + p_l), NULL) as p_win_loss_perc_csk, SUM(p_l IS NULL)+SUM(p_w IS NULL) as p_win_loss_perc_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(p_w + p_l), SUM(p_w) / SUM(p_w + p_l), NULL),3)) AS p_win_loss_perc, IF(SUM(p_ip_outs), 27 * SUM(p_er) /SUM(p_ip_outs), IF(SUM(p_er), 1e20, NULL)) as p_earned_run_avg_csk, SUM(p_ip_outs IS NULL)+SUM(p_er IS NULL) as p_earned_run_avg_incomplete, ROUND(IF(SUM(p_ip_outs), 27 * SUM(p_er)/SUM(p_ip_outs), NULL),2) AS p_earned_run_avg, NULL as p_g_incomplete, SUM(p_g) AS p_g, SUM(p_gs IS NULL) as p_gs_incomplete, SUM(p_gs) AS p_gs, SUM(p_gf IS NULL) as p_gf_incomplete, SUM(p_gf) AS p_gf, SUM(p_cg IS NULL) as p_cg_incomplete, SUM(p_cg) AS p_cg, SUM(p_sho IS NULL) as p_sho_incomplete, SUM(p_sho) AS p_sho, SUM(p_sv IS NULL) as p_sv_incomplete, SUM(p_sv) AS p_sv, SUM(p_ip_outs) as p_ip_csk, SUM(p_ip_outs IS NULL) as p_ip_incomplete, SUM(p_ip_outs) DIV 3 + 0.1 * MOD(SUM(p_ip_outs),3) AS p_ip, SUM(p_h IS NULL) as p_h_incomplete, SUM(p_h) AS p_h, SUM(p_r IS NULL) as p_r_incomplete, SUM(p_r) AS p_r, SUM(p_er IS NULL) as p_er_incomplete, SUM(p_er) AS p_er, SUM(p_hr IS NULL) as p_hr_incomplete, SUM(p_hr) AS p_hr, SUM(p_bb IS NULL) as p_bb_incomplete, SUM(p_bb) AS p_bb, SUM(p_ibb IS NULL) as p_ibb_incomplete, SUM(p_ibb) AS p_ibb, SUM(p_so IS NULL) as p_so_incomplete, SUM(p_so) AS p_so, SUM(p_hbp IS NULL) as p_hbp_incomplete, SUM(p_hbp) AS p_hbp, SUM(p_bk IS NULL) as p_bk_incomplete, SUM(p_bk) AS p_bk, SUM(p_wp IS NULL) as p_wp_incomplete, SUM(p_wp) AS p_wp, SUM(p_bfp IS NULL) as p_bfp_incomplete, SUM(p_bfp) AS p_bfp, SUM(p_reached_on_strikeout IS NULL)+SUM(p_bb IS NULL)+SUM(p_roe IS NULL)+SUM(p_hbp IS NULL)+SUM(p_h IS NULL) as p_baserunners_incomplete, SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_roe,0) + IFNULL(p_reached_on_strikeout,0)) AS p_baserunners, IF(SUM(IFNULL(p_er,0)) = 0, NULL, 100*(SUM(p_er_lg_avg) / SUM(p_er))) as p_earned_run_avg_plus_csk, SUM(p_er IS NULL)+SUM(p_er_lg_avg IS NULL) as p_earned_run_avg_plus_incomplete, ROUND(IF(SUM(IFNULL(p_er,0)) = 0, NULL, 100*(SUM(p_er_lg_avg) / SUM(p_er))),0) AS p_earned_run_avg_plus, SUM(p_ip_outs*((39*p_hr + 9*(p_bb + IFNULL(p_hbp,0)) - 6 * p_so)/p_ip_outs  + fip_constant))/SUM(p_ip_outs) as p_fip_csk, SUM(p_hbp IS NULL)+SUM(fip_constant IS NULL)+SUM(p_ip_outs IS NULL)+SUM(p_bb IS NULL)+SUM(p_hr IS NULL)+SUM(p_so IS NULL) as p_fip_incomplete, ROUND(SUM(p_ip_outs*((39*p_hr + 9*(p_bb + IFNULL(p_hbp,0)) - 6 * p_so)/p_ip_outs  + fip_constant))/SUM(p_ip_outs),2) AS p_fip, IF(SUM(p_ip_outs) = 0, NULL, 3 * SUM(p_h + p_bb) / SUM(p_ip_outs)) as p_whip_csk, SUM(p_h IS NULL)+SUM(p_ip_outs IS NULL)+SUM(p_bb IS NULL) as p_whip_incomplete, ROUND(IF(SUM(p_ip_outs) = 0, NULL, 3 * SUM(p_h + p_bb) / SUM(p_ip_outs)),3) AS p_whip, IF(SUM(p_ip_outs) = 0, NULL, 27 * SUM(p_h) / SUM(p_ip_outs)) as p_hits_per_nine_csk, SUM(p_ip_outs IS NULL)+SUM(p_h IS NULL) as p_hits_per_nine_incomplete, ROUND(IF(SUM(p_ip_outs) = 0, NULL, 27 * SUM(p_h) / SUM(p_ip_outs)),1) AS p_hits_per_nine, IF(SUM(p_ip_outs) = 0, NULL, 27 * SUM(p_hr) / SUM(p_ip_outs)) as p_hr_per_nine_csk, SUM(p_ip_outs IS NULL)+SUM(p_hr IS NULL) as p_hr_per_nine_incomplete, ROUND(IF(SUM(p_ip_outs) = 0, NULL, 27 * SUM(p_hr) / SUM(p_ip_outs)),1) AS p_hr_per_nine, IF(SUM(p_ip_outs) = 0, NULL, 27 * SUM(p_bb) / SUM(p_ip_outs)) as p_bb_per_nine_csk, SUM(p_ip_outs IS NULL)+SUM(p_bb IS NULL) as p_bb_per_nine_incomplete, ROUND(IF(SUM(p_ip_outs) = 0, NULL, 27 * SUM(p_bb) / SUM(p_ip_outs)),1) AS p_bb_per_nine, IF(SUM(p_ip_outs) = 0, NULL, 27 * SUM(p_so) / SUM(p_ip_outs)) as p_so_per_nine_csk, SUM(p_ip_outs IS NULL)+SUM(p_so IS NULL) as p_so_per_nine_incomplete, ROUND(IF(SUM(p_ip_outs) = 0, NULL, 27 * SUM(p_so) / SUM(p_ip_outs)),1) AS p_so_per_nine
FROM sup_player_team_seasons as st
  JOIN sup_people USING (person_id)
  JOIN sup_players USING (person_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN sup_comp_seasons USING (comp_id, year_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="post" 
GROUP BY person_id
HAVING p_g>0
ORDER BY person_id 

SQL PARAMS -- $VAR1 = [
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.00 seconds
Table Build Time: 0.04 seconds

Table Build Time: 0.04 seconds


--------------------------------------

pitch_val

Page Setup Time: 0.00064 seconds

SELECT person_id, IF(MIN(age)=MAX(age), MIN(age), CONCAT(MIN(age), '-', MAX(age))) as age_range, MIN(year_id) as year_min, MAX(year_id) as year_max, NULL as p_g_incomplete, SUM(p_g) AS p_g, SUM(p_gs IS NULL) as p_gs_incomplete, SUM(p_gs) AS p_gs, SUM(p_ip_outs) as p_ip_csk, SUM(p_ip_outs IS NULL) as p_ip_incomplete, SUM(p_ip_outs) DIV 3 + 0.1 * MOD(SUM(p_ip_outs),3) AS p_ip, SUM(p_war) as p_war_csk, SUM(p_war IS NULL) as p_war_incomplete, ROUND(SUM(p_war),1) AS p_war, SUM(p_waa) as p_waa_csk, SUM(p_waa IS NULL) as p_waa_incomplete, ROUND(SUM(p_waa),1) AS p_waa
FROM sup_player_team_seasons as st
  JOIN sup_people USING (person_id)
  JOIN sup_players USING (person_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN sup_comp_seasons USING (comp_id, year_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="reg" 
GROUP BY person_id
HAVING p_g>0
ORDER BY person_id 

SQL PARAMS -- $VAR1 = [
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.00 seconds
Table Build Time: 0.03 seconds


--------------------------------------

pitch_tot_ag

Page Setup Time: 0.00220 seconds

SELECT person_id, IF(MIN(age)=MAX(age), MIN(age), CONCAT(MIN(age), '-', MAX(age))) as age_range, MIN(year_id) as year_min, MAX(year_id) as year_max, NULL as p_g_incomplete, SUM(p_g) AS p_g, SUM(p_gs IS NULL) as p_gs_incomplete, SUM(p_gs) AS p_gs, SUM(p_ip_outs) as p_ip_csk, SUM(p_ip_outs IS NULL) as p_ip_incomplete, SUM(p_ip_outs) DIV 3 + 0.1 * MOD(SUM(p_ip_outs),3) AS p_ip, SUM(p_bb IS NULL)+SUM(p_reached_on_strikeout IS NULL)+SUM(p_roe IS NULL)+SUM(p_hbp IS NULL)+SUM(p_h IS NULL) as p_baserunners_incomplete, SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_roe,0) + IFNULL(p_reached_on_strikeout,0)) AS p_baserunners, SUM(p_ab IS NULL) as p_ab_incomplete, SUM(p_ab) AS p_ab, SUM(p_hr IS NULL)+SUM(p_doubles IS NULL)+SUM(p_h IS NULL)+SUM(p_triples IS NULL) as p_singles_incomplete, SUM(p_h - (p_doubles + p_triples + p_hr)) AS p_singles, SUM(p_doubles IS NULL) as p_doubles_incomplete, SUM(p_doubles) AS p_doubles, SUM(p_triples IS NULL) as p_triples_incomplete, SUM(p_triples) AS p_triples, SUM(p_sb IS NULL) as p_sb_incomplete, SUM(p_sb) AS p_sb, SUM(p_cs IS NULL) as p_cs_incomplete, SUM(p_cs) AS p_cs, IF(SUM(p_sb+p_cs) = 0 OR SUM(p_sb+p_cs) IS NULL,NULL,SUM(p_sb)/SUM(p_sb+p_cs)) as p_stolen_base_perc_csk, SUM(p_cs IS NULL)+SUM(p_sb IS NULL) as p_stolen_base_perc_incomplete, ROUND(100 * (IF(SUM(p_sb+p_cs) = 0 OR SUM(p_sb+p_cs) IS NULL,NULL,SUM(p_sb)/SUM(p_sb+p_cs))),2) AS p_stolen_base_perc, SUM(p_pickoffs IS NULL) as p_pickoffs_incomplete, SUM(p_pickoffs) AS p_pickoffs, SUM(p_gidp IS NULL) as p_gidp_incomplete, SUM(p_gidp) AS p_gidp, SUM(p_sh IS NULL) as p_sh_incomplete, SUM(p_sh) AS p_sh, SUM(p_sf IS NULL) as p_sf_incomplete, SUM(p_sf) AS p_sf, IF(SUM(p_ab) = 0, NULL, SUM(p_h) / SUM(p_ab)) as p_batting_avg_csk, SUM(p_h IS NULL)+SUM(p_ab IS NULL) as p_batting_avg_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(p_ab) = 0, NULL, SUM(p_h) / SUM(p_ab)),3)) AS p_batting_avg, IF(SUM(p_ab + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_sf,0)) = 0, NULL, SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0)) / SUM(p_ab + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_sf,0))) as p_onbase_perc_csk, SUM(p_hbp IS NULL)+SUM(p_h IS NULL)+SUM(p_bb IS NULL)+SUM(p_sf IS NULL)+SUM(p_ab IS NULL) as p_onbase_perc_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(p_ab + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_sf,0)) = 0, NULL, SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0)) / SUM(p_ab + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_sf,0))),3)) AS p_onbase_perc, IF(SUM(p_ab) = 0, NULL, SUM(p_h + p_doubles + (2 * p_triples) + (3 * p_hr)) / SUM(p_ab)) as p_slugging_perc_csk, SUM(p_doubles IS NULL)+SUM(p_triples IS NULL)+SUM(p_h IS NULL)+SUM(p_hr IS NULL)+SUM(p_ab IS NULL) as p_slugging_perc_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(p_ab) = 0, NULL, SUM(p_h + p_doubles + (2 * p_triples) + (3 * p_hr)) / SUM(p_ab)),3)) AS p_slugging_perc, IF(SUM(p_ab + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_sf,0)) = 0, NULL, SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0)) / SUM(p_ab + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_sf,0))) + IF(SUM(p_ab) = 0, NULL, SUM(p_h + p_doubles + (2 * p_triples) + (3 * p_hr)) / SUM(p_ab)) as p_onbase_plus_slugging_csk, SUM(p_sf IS NULL)+SUM(p_bb IS NULL)+SUM(p_hr IS NULL)+SUM(p_ab IS NULL)+SUM(p_doubles IS NULL)+SUM(p_hbp IS NULL)+SUM(p_triples IS NULL)+SUM(p_h IS NULL) as p_onbase_plus_slugging_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(p_ab + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_sf,0)) = 0, NULL, SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0)) / SUM(p_ab + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_sf,0))) + IF(SUM(p_ab) = 0, NULL, SUM(p_h + p_doubles + (2 * p_triples) + (3 * p_hr)) / SUM(p_ab)),3)) AS p_onbase_plus_slugging, IF(sum(p_tob_lg_avg) = 0 || sum(p_tb_lg_avg) = 0, NULL, 100*((SUM(p_h + p_doubles + (2 * p_triples) + (3 * p_hr)) / sum(p_tb_lg_avg)) + (SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0))/sum(p_tob_lg_avg)) - 1)) as p_onbase_plus_slugging_plus_csk, SUM(p_hr IS NULL)+SUM(p_bb IS NULL)+SUM(p_tb_lg_avg IS NULL)+SUM(p_hbp IS NULL)+SUM(p_doubles IS NULL)+SUM(p_h IS NULL)+SUM(p_triples IS NULL)+SUM(p_tob_lg_avg IS NULL) as p_onbase_plus_slugging_plus_incomplete, ROUND(IF(sum(p_tob_lg_avg) = 0 || sum(p_tb_lg_avg) = 0, NULL, 100*((SUM(p_h + p_doubles + (2 * p_triples) + (3 * p_hr)) / sum(p_tb_lg_avg)) + (SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0))/sum(p_tob_lg_avg)) - 1)),0) AS p_onbase_plus_slugging_plus, IF(SUM(p_ab) = 0, NULL, SUM(p_doubles + (2 * p_triples) + (3 * p_hr)) / SUM(p_ab)) as p_iso_slugging_csk, SUM(p_hr IS NULL)+SUM(p_ab IS NULL)+SUM(p_doubles IS NULL)+SUM(p_triples IS NULL) as p_iso_slugging_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(p_ab) = 0, NULL, SUM(p_doubles + (2 * p_triples) + (3 * p_hr)) / SUM(p_ab)),3)) AS p_iso_slugging, IF(SUM(p_ab-p_hr-IFNULL(p_so,0)+IFNULL(p_sf,0)) = 0, NULL, ROUND(SUM(p_h-p_hr)/SUM(p_ab-p_hr-IFNULL(p_so,0)+IFNULL(p_sf,0)),10)) as p_batting_avg_bip_csk, SUM(p_h IS NULL)+SUM(p_ab IS NULL)+SUM(p_so IS NULL)+SUM(p_sf IS NULL)+SUM(p_hr IS NULL) as p_batting_avg_bip_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(p_ab-p_hr-IFNULL(p_so,0)+IFNULL(p_sf,0)) = 0, NULL, ROUND(SUM(p_h-p_hr)/SUM(p_ab-p_hr-IFNULL(p_so,0)+IFNULL(p_sf,0)),10)),3)) AS p_batting_avg_bip, SUM(p_runs_created IS NULL) as p_runs_created_incomplete, SUM(p_runs_created) AS p_runs_created, SUM(p_tb IS NULL) as p_tb_incomplete, SUM(p_tb) AS p_tb, SUM(p_hr IS NULL)+SUM(p_doubles IS NULL)+SUM(p_triples IS NULL) as p_xbh_incomplete, SUM(p_doubles + p_triples + p_hr) AS p_xbh, SUM(p_h IS NULL)+SUM(p_hbp IS NULL)+SUM(p_bb IS NULL) as p_tob_incomplete, SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0)) AS p_tob, SUM(p_roe IS NULL)+SUM(p_bb IS NULL)+SUM(p_reached_on_strikeout IS NULL)+SUM(p_h IS NULL)+SUM(p_hbp IS NULL) as p_tob_with_roe_incomplete, SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_roe,0) + IFNULL(p_reached_on_strikeout,0)) AS p_tob_with_roe
FROM sup_player_team_seasons as st
  JOIN sup_people USING (person_id)
  JOIN sup_players USING (person_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN sup_comp_seasons USING (comp_id, year_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="reg" 
GROUP BY person_id
HAVING p_g>0
ORDER BY person_id 

SQL PARAMS -- $VAR1 = [
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.01 seconds
SELECT person_id, IF(MIN(age)=MAX(age), MIN(age), CONCAT(MIN(age), '-', MAX(age))) as age_range, MIN(year_id) as year_min, MAX(year_id) as year_max, NULL as p_g_incomplete, SUM(p_g) AS p_g, SUM(p_gs IS NULL) as p_gs_incomplete, SUM(p_gs) AS p_gs, SUM(p_ip_outs) as p_ip_csk, SUM(p_ip_outs IS NULL) as p_ip_incomplete, SUM(p_ip_outs) DIV 3 + 0.1 * MOD(SUM(p_ip_outs),3) AS p_ip, SUM(p_bb IS NULL)+SUM(p_reached_on_strikeout IS NULL)+SUM(p_roe IS NULL)+SUM(p_hbp IS NULL)+SUM(p_h IS NULL) as p_baserunners_incomplete, SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_roe,0) + IFNULL(p_reached_on_strikeout,0)) AS p_baserunners, SUM(p_ab IS NULL) as p_ab_incomplete, SUM(p_ab) AS p_ab, SUM(p_hr IS NULL)+SUM(p_doubles IS NULL)+SUM(p_h IS NULL)+SUM(p_triples IS NULL) as p_singles_incomplete, SUM(p_h - (p_doubles + p_triples + p_hr)) AS p_singles, SUM(p_doubles IS NULL) as p_doubles_incomplete, SUM(p_doubles) AS p_doubles, SUM(p_triples IS NULL) as p_triples_incomplete, SUM(p_triples) AS p_triples, SUM(p_sb IS NULL) as p_sb_incomplete, SUM(p_sb) AS p_sb, SUM(p_cs IS NULL) as p_cs_incomplete, SUM(p_cs) AS p_cs, IF(SUM(p_sb+p_cs) = 0 OR SUM(p_sb+p_cs) IS NULL,NULL,SUM(p_sb)/SUM(p_sb+p_cs)) as p_stolen_base_perc_csk, SUM(p_cs IS NULL)+SUM(p_sb IS NULL) as p_stolen_base_perc_incomplete, ROUND(100 * (IF(SUM(p_sb+p_cs) = 0 OR SUM(p_sb+p_cs) IS NULL,NULL,SUM(p_sb)/SUM(p_sb+p_cs))),2) AS p_stolen_base_perc, SUM(p_pickoffs IS NULL) as p_pickoffs_incomplete, SUM(p_pickoffs) AS p_pickoffs, SUM(p_gidp IS NULL) as p_gidp_incomplete, SUM(p_gidp) AS p_gidp, SUM(p_sh IS NULL) as p_sh_incomplete, SUM(p_sh) AS p_sh, SUM(p_sf IS NULL) as p_sf_incomplete, SUM(p_sf) AS p_sf, IF(SUM(p_ab) = 0, NULL, SUM(p_h) / SUM(p_ab)) as p_batting_avg_csk, SUM(p_h IS NULL)+SUM(p_ab IS NULL) as p_batting_avg_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(p_ab) = 0, NULL, SUM(p_h) / SUM(p_ab)),3)) AS p_batting_avg, IF(SUM(p_ab + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_sf,0)) = 0, NULL, SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0)) / SUM(p_ab + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_sf,0))) as p_onbase_perc_csk, SUM(p_hbp IS NULL)+SUM(p_h IS NULL)+SUM(p_bb IS NULL)+SUM(p_sf IS NULL)+SUM(p_ab IS NULL) as p_onbase_perc_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(p_ab + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_sf,0)) = 0, NULL, SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0)) / SUM(p_ab + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_sf,0))),3)) AS p_onbase_perc, IF(SUM(p_ab) = 0, NULL, SUM(p_h + p_doubles + (2 * p_triples) + (3 * p_hr)) / SUM(p_ab)) as p_slugging_perc_csk, SUM(p_doubles IS NULL)+SUM(p_triples IS NULL)+SUM(p_h IS NULL)+SUM(p_hr IS NULL)+SUM(p_ab IS NULL) as p_slugging_perc_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(p_ab) = 0, NULL, SUM(p_h + p_doubles + (2 * p_triples) + (3 * p_hr)) / SUM(p_ab)),3)) AS p_slugging_perc, IF(SUM(p_ab + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_sf,0)) = 0, NULL, SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0)) / SUM(p_ab + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_sf,0))) + IF(SUM(p_ab) = 0, NULL, SUM(p_h + p_doubles + (2 * p_triples) + (3 * p_hr)) / SUM(p_ab)) as p_onbase_plus_slugging_csk, SUM(p_sf IS NULL)+SUM(p_bb IS NULL)+SUM(p_hr IS NULL)+SUM(p_ab IS NULL)+SUM(p_doubles IS NULL)+SUM(p_hbp IS NULL)+SUM(p_triples IS NULL)+SUM(p_h IS NULL) as p_onbase_plus_slugging_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(p_ab + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_sf,0)) = 0, NULL, SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0)) / SUM(p_ab + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_sf,0))) + IF(SUM(p_ab) = 0, NULL, SUM(p_h + p_doubles + (2 * p_triples) + (3 * p_hr)) / SUM(p_ab)),3)) AS p_onbase_plus_slugging, IF(sum(p_tob_lg_avg) = 0 || sum(p_tb_lg_avg) = 0, NULL, 100*((SUM(p_h + p_doubles + (2 * p_triples) + (3 * p_hr)) / sum(p_tb_lg_avg)) + (SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0))/sum(p_tob_lg_avg)) - 1)) as p_onbase_plus_slugging_plus_csk, SUM(p_hr IS NULL)+SUM(p_bb IS NULL)+SUM(p_tb_lg_avg IS NULL)+SUM(p_hbp IS NULL)+SUM(p_doubles IS NULL)+SUM(p_h IS NULL)+SUM(p_triples IS NULL)+SUM(p_tob_lg_avg IS NULL) as p_onbase_plus_slugging_plus_incomplete, ROUND(IF(sum(p_tob_lg_avg) = 0 || sum(p_tb_lg_avg) = 0, NULL, 100*((SUM(p_h + p_doubles + (2 * p_triples) + (3 * p_hr)) / sum(p_tb_lg_avg)) + (SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0))/sum(p_tob_lg_avg)) - 1)),0) AS p_onbase_plus_slugging_plus, IF(SUM(p_ab) = 0, NULL, SUM(p_doubles + (2 * p_triples) + (3 * p_hr)) / SUM(p_ab)) as p_iso_slugging_csk, SUM(p_hr IS NULL)+SUM(p_ab IS NULL)+SUM(p_doubles IS NULL)+SUM(p_triples IS NULL) as p_iso_slugging_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(p_ab) = 0, NULL, SUM(p_doubles + (2 * p_triples) + (3 * p_hr)) / SUM(p_ab)),3)) AS p_iso_slugging, IF(SUM(p_ab-p_hr-IFNULL(p_so,0)+IFNULL(p_sf,0)) = 0, NULL, ROUND(SUM(p_h-p_hr)/SUM(p_ab-p_hr-IFNULL(p_so,0)+IFNULL(p_sf,0)),10)) as p_batting_avg_bip_csk, SUM(p_h IS NULL)+SUM(p_ab IS NULL)+SUM(p_so IS NULL)+SUM(p_sf IS NULL)+SUM(p_hr IS NULL) as p_batting_avg_bip_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(p_ab-p_hr-IFNULL(p_so,0)+IFNULL(p_sf,0)) = 0, NULL, ROUND(SUM(p_h-p_hr)/SUM(p_ab-p_hr-IFNULL(p_so,0)+IFNULL(p_sf,0)),10)),3)) AS p_batting_avg_bip, SUM(p_runs_created IS NULL) as p_runs_created_incomplete, SUM(p_runs_created) AS p_runs_created, SUM(p_tb IS NULL) as p_tb_incomplete, SUM(p_tb) AS p_tb, SUM(p_hr IS NULL)+SUM(p_doubles IS NULL)+SUM(p_triples IS NULL) as p_xbh_incomplete, SUM(p_doubles + p_triples + p_hr) AS p_xbh, SUM(p_h IS NULL)+SUM(p_hbp IS NULL)+SUM(p_bb IS NULL) as p_tob_incomplete, SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0)) AS p_tob, SUM(p_roe IS NULL)+SUM(p_bb IS NULL)+SUM(p_reached_on_strikeout IS NULL)+SUM(p_h IS NULL)+SUM(p_hbp IS NULL) as p_tob_with_roe_incomplete, SUM(p_h + IFNULL(p_bb,0) + IFNULL(p_hbp,0) + IFNULL(p_roe,0) + IFNULL(p_reached_on_strikeout,0)) AS p_tob_with_roe
FROM sup_player_team_seasons as st
  JOIN sup_people USING (person_id)
  JOIN sup_players USING (person_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN sup_comp_seasons USING (comp_id, year_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="post" 
GROUP BY person_id
HAVING p_g>0
ORDER BY person_id 

SQL PARAMS -- $VAR1 = [
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.00 seconds
Table Build Time: 0.04 seconds

Table Build Time: 0.04 seconds


--------------------------------------

pitch_tot_sr

Page Setup Time: 0.00120 seconds

SELECT person_id, IF(MIN(age)=MAX(age), MIN(age), CONCAT(MIN(age), '-', MAX(age))) as age_range, MIN(year_id) as year_min, MAX(year_id) as year_max, SUM(p_qs IS NULL) as p_qs_incomplete, SUM(p_qs) AS p_qs, IF(SUM(p_gs) = 0, NULL, SUM(p_qs) / SUM(p_gs)) as p_quality_start_perc_csk, SUM(p_gs IS NULL)+SUM(p_qs IS NULL) as p_quality_start_perc_incomplete, ROUND(100 * (IF(SUM(p_gs) = 0, NULL, SUM(p_qs) / SUM(p_gs))),0) AS p_quality_start_perc, IF(SUM(p_gs), SUM(p_game_score_sum) / SUM(p_gs), NULL) as p_game_score_avg_csk, SUM(p_game_score_sum IS NULL)+SUM(p_gs IS NULL) as p_game_score_avg_incomplete, ROUND(IF(SUM(p_gs), SUM(p_game_score_sum) / SUM(p_gs), NULL),1) AS p_game_score_avg, SUM(p_inherited_runners IS NULL) as p_inherited_runners_incomplete, SUM(p_inherited_runners) AS p_inherited_runners, SUM(p_inherited_scored IS NULL) as p_inherited_scored_incomplete, SUM(p_inherited_scored) AS p_inherited_scored, IF(SUM(p_inherited_runners) = 0, NULL, SUM(p_inherited_scored) / SUM(p_inherited_runners)) as p_inherited_scored_perc_csk, SUM(p_inherited_runners IS NULL)+SUM(p_inherited_scored IS NULL) as p_inherited_scored_perc_incomplete, ROUND(100 * (IF(SUM(p_inherited_runners) = 0, NULL, SUM(p_inherited_scored) / SUM(p_inherited_runners))),0) AS p_inherited_scored_perc, SUM(p_blown_saves IS NULL) as p_blown_saves_incomplete, SUM(p_blown_saves) AS p_blown_saves, IF(SUM(IFNULL(p_blown_saves,0) + p_sv) = 0, NULL, SUM(p_sv) / SUM(IFNULL(p_blown_saves,0) + p_sv)) as p_save_perc_csk, SUM(p_blown_saves IS NULL)+SUM(p_sv IS NULL) as p_save_perc_incomplete, ROUND(100 * (IF(SUM(IFNULL(p_blown_saves,0) + p_sv) = 0, NULL, SUM(p_sv) / SUM(IFNULL(p_blown_saves,0) + p_sv))),1) AS p_save_perc, SUM(p_gf IS NULL) as p_gf_incomplete, SUM(p_gf) AS p_gf, SUM(p_gs IS NULL)+SUM(p_g IS NULL) as p_gr_incomplete, SUM(p_g - p_gs) AS p_gr
FROM sup_player_team_seasons as st
  JOIN sup_people USING (person_id)
  JOIN sup_players USING (person_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN sup_comp_seasons USING (comp_id, year_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="reg"
  AND p_g>0 
GROUP BY person_id
ORDER BY person_id 

SQL PARAMS -- $VAR1 = [
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.00 seconds
SELECT person_id, IF(MIN(age)=MAX(age), MIN(age), CONCAT(MIN(age), '-', MAX(age))) as age_range, MIN(year_id) as year_min, MAX(year_id) as year_max, SUM(p_qs IS NULL) as p_qs_incomplete, SUM(p_qs) AS p_qs, IF(SUM(p_gs) = 0, NULL, SUM(p_qs) / SUM(p_gs)) as p_quality_start_perc_csk, SUM(p_gs IS NULL)+SUM(p_qs IS NULL) as p_quality_start_perc_incomplete, ROUND(100 * (IF(SUM(p_gs) = 0, NULL, SUM(p_qs) / SUM(p_gs))),0) AS p_quality_start_perc, IF(SUM(p_gs), SUM(p_game_score_sum) / SUM(p_gs), NULL) as p_game_score_avg_csk, SUM(p_game_score_sum IS NULL)+SUM(p_gs IS NULL) as p_game_score_avg_incomplete, ROUND(IF(SUM(p_gs), SUM(p_game_score_sum) / SUM(p_gs), NULL),1) AS p_game_score_avg, SUM(p_inherited_runners IS NULL) as p_inherited_runners_incomplete, SUM(p_inherited_runners) AS p_inherited_runners, SUM(p_inherited_scored IS NULL) as p_inherited_scored_incomplete, SUM(p_inherited_scored) AS p_inherited_scored, IF(SUM(p_inherited_runners) = 0, NULL, SUM(p_inherited_scored) / SUM(p_inherited_runners)) as p_inherited_scored_perc_csk, SUM(p_inherited_runners IS NULL)+SUM(p_inherited_scored IS NULL) as p_inherited_scored_perc_incomplete, ROUND(100 * (IF(SUM(p_inherited_runners) = 0, NULL, SUM(p_inherited_scored) / SUM(p_inherited_runners))),0) AS p_inherited_scored_perc, SUM(p_blown_saves IS NULL) as p_blown_saves_incomplete, SUM(p_blown_saves) AS p_blown_saves, IF(SUM(IFNULL(p_blown_saves,0) + p_sv) = 0, NULL, SUM(p_sv) / SUM(IFNULL(p_blown_saves,0) + p_sv)) as p_save_perc_csk, SUM(p_blown_saves IS NULL)+SUM(p_sv IS NULL) as p_save_perc_incomplete, ROUND(100 * (IF(SUM(IFNULL(p_blown_saves,0) + p_sv) = 0, NULL, SUM(p_sv) / SUM(IFNULL(p_blown_saves,0) + p_sv))),1) AS p_save_perc, SUM(p_gf IS NULL) as p_gf_incomplete, SUM(p_gf) AS p_gf, SUM(p_gs IS NULL)+SUM(p_g IS NULL) as p_gr_incomplete, SUM(p_g - p_gs) AS p_gr
FROM sup_player_team_seasons as st
  JOIN sup_people USING (person_id)
  JOIN sup_players USING (person_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN sup_comp_seasons USING (comp_id, year_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="post"
  AND p_g>0 
GROUP BY person_id
ORDER BY person_id 

SQL PARAMS -- $VAR1 = [
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.00 seconds
Table Build Time: 0.04 seconds

Table Build Time: 0.04 seconds


--------------------------------------

pitch_ratio

Page Setup Time: 0.00097 seconds

SELECT person_id, IF(MIN(age)=MAX(age), MIN(age), CONCAT(MIN(age), '-', MAX(age))) as age_range, MIN(year_id) as year_min, MAX(year_id) as year_max, NULL as p_g_incomplete, SUM(p_g) AS p_g, SUM(p_gs IS NULL) as p_gs_incomplete, SUM(p_gs) AS p_gs, SUM(p_ip_outs) as p_ip_csk, SUM(p_ip_outs IS NULL) as p_ip_incomplete, SUM(p_ip_outs) DIV 3 + 0.1 * MOD(SUM(p_ip_outs),3) AS p_ip, IF(SUM(p_bfp)=0 OR SUM(ISNULL(p_bfp)) != SUM(ISNULL(p_so)), NULL, SUM(p_so)/SUM(p_bfp)) as p_strikeout_perc_csk, SUM(p_bfp IS NULL)+SUM(p_so IS NULL) as p_strikeout_perc_incomplete, ROUND(100 * (IF(SUM(p_bfp)=0 OR SUM(ISNULL(p_bfp)) != SUM(ISNULL(p_so)), NULL, SUM(p_so)/SUM(p_bfp))),1) AS p_strikeout_perc, IF(SUM(p_bfp)=0 OR SUM(ISNULL(p_bfp)) != SUM(ISNULL(p_bb)), NULL, SUM(p_bb)/SUM(p_bfp)) as p_base_on_balls_perc_csk, SUM(p_bb IS NULL)+SUM(p_bfp IS NULL) as p_base_on_balls_perc_incomplete, ROUND(100 * (IF(SUM(p_bfp)=0 OR SUM(ISNULL(p_bfp)) != SUM(ISNULL(p_bb)), NULL, SUM(p_bb)/SUM(p_bfp))),1) AS p_base_on_balls_perc, IF(SUM(p_bfp)=0,NULL,SUM(p_so-p_bb)/SUM(p_bfp)) as p_strikeout_minus_base_on_balls_perc_csk, SUM(p_bb IS NULL)+SUM(p_so IS NULL)+SUM(p_bfp IS NULL) as p_strikeout_minus_base_on_balls_perc_incomplete, ROUND(100 * (IF(SUM(p_bfp)=0,NULL,SUM(p_so-p_bb)/SUM(p_bfp))),1) AS p_strikeout_minus_base_on_balls_perc
FROM sup_player_team_seasons as st
  JOIN sup_people USING (person_id)
  JOIN sup_players USING (person_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN sup_comp_seasons USING (comp_id, year_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="reg" 
GROUP BY person_id
HAVING p_g>0
ORDER BY person_id 

SQL PARAMS -- $VAR1 = [
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.00 seconds
SELECT person_id, IF(MIN(age)=MAX(age), MIN(age), CONCAT(MIN(age), '-', MAX(age))) as age_range, MIN(year_id) as year_min, MAX(year_id) as year_max, NULL as p_g_incomplete, SUM(p_g) AS p_g, SUM(p_gs IS NULL) as p_gs_incomplete, SUM(p_gs) AS p_gs, SUM(p_ip_outs) as p_ip_csk, SUM(p_ip_outs IS NULL) as p_ip_incomplete, SUM(p_ip_outs) DIV 3 + 0.1 * MOD(SUM(p_ip_outs),3) AS p_ip, IF(SUM(p_bfp)=0 OR SUM(ISNULL(p_bfp)) != SUM(ISNULL(p_so)), NULL, SUM(p_so)/SUM(p_bfp)) as p_strikeout_perc_csk, SUM(p_bfp IS NULL)+SUM(p_so IS NULL) as p_strikeout_perc_incomplete, ROUND(100 * (IF(SUM(p_bfp)=0 OR SUM(ISNULL(p_bfp)) != SUM(ISNULL(p_so)), NULL, SUM(p_so)/SUM(p_bfp))),1) AS p_strikeout_perc, IF(SUM(p_bfp)=0 OR SUM(ISNULL(p_bfp)) != SUM(ISNULL(p_bb)), NULL, SUM(p_bb)/SUM(p_bfp)) as p_base_on_balls_perc_csk, SUM(p_bb IS NULL)+SUM(p_bfp IS NULL) as p_base_on_balls_perc_incomplete, ROUND(100 * (IF(SUM(p_bfp)=0 OR SUM(ISNULL(p_bfp)) != SUM(ISNULL(p_bb)), NULL, SUM(p_bb)/SUM(p_bfp))),1) AS p_base_on_balls_perc, IF(SUM(p_bfp)=0,NULL,SUM(p_so-p_bb)/SUM(p_bfp)) as p_strikeout_minus_base_on_balls_perc_csk, SUM(p_bb IS NULL)+SUM(p_so IS NULL)+SUM(p_bfp IS NULL) as p_strikeout_minus_base_on_balls_perc_incomplete, ROUND(100 * (IF(SUM(p_bfp)=0,NULL,SUM(p_so-p_bb)/SUM(p_bfp))),1) AS p_strikeout_minus_base_on_balls_perc
FROM sup_player_team_seasons as st
  JOIN sup_people USING (person_id)
  JOIN sup_players USING (person_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN sup_comp_seasons USING (comp_id, year_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="post" 
GROUP BY person_id
HAVING p_g>0
ORDER BY person_id 

SQL PARAMS -- $VAR1 = [
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.00 seconds
Table Build Time: 0.03 seconds

Table Build Time: 0.03 seconds


--------------------------------------

pitch_pitchsum

Page Setup Time: 0.00087 seconds

SELECT person_id, IF(MIN(age)=MAX(age), MIN(age), CONCAT(MIN(age), '-', MAX(age))) as age_range, MIN(year_id) as year_min, MAX(year_id) as year_max, NULL as p_g_incomplete, SUM(p_g) AS p_g, SUM(p_gs IS NULL) as p_gs_incomplete, SUM(p_gs) AS p_gs, SUM(p_ip_outs) as p_ip_csk, SUM(p_ip_outs IS NULL) as p_ip_incomplete, SUM(p_ip_outs) DIV 3 + 0.1 * MOD(SUM(p_ip_outs),3) AS p_ip, SUM(p_pitches IS NULL) as p_pitches_incomplete, SUM(p_pitches) AS p_pitches, IF(SUM(p_gs_with_pitches) = 0, NULL, SUM(p_pitches_in_gs) / SUM(p_gs_with_pitches)) as p_pitches_per_start_csk, SUM(p_pitches_in_gs IS NULL)+SUM(p_gs_with_pitches IS NULL) as p_pitches_per_start_incomplete, ROUND(IF(SUM(p_gs_with_pitches) = 0, NULL, SUM(p_pitches_in_gs) / SUM(p_gs_with_pitches)),0) AS p_pitches_per_start, SUM(p_strikes IS NULL) as p_strikes_incomplete, SUM(p_strikes) AS p_strikes, IF(SUM(p_pitches) = 0, NULL, SUM(p_strikes) / SUM(p_pitches)) as p_strike_perc_csk, SUM(p_strikes IS NULL)+SUM(p_pitches IS NULL) as p_strike_perc_incomplete, ROUND(100 * (IF(SUM(p_pitches) = 0, NULL, SUM(p_strikes) / SUM(p_pitches))),2) AS p_strike_perc
FROM sup_player_team_seasons as st
  JOIN sup_people USING (person_id)
  JOIN sup_players USING (person_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN sup_comp_seasons USING (comp_id, year_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="reg" 
GROUP BY person_id
HAVING p_g>0
ORDER BY person_id 

SQL PARAMS -- $VAR1 = [
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.00 seconds
SELECT person_id, IF(MIN(age)=MAX(age), MIN(age), CONCAT(MIN(age), '-', MAX(age))) as age_range, MIN(year_id) as year_min, MAX(year_id) as year_max, NULL as p_g_incomplete, SUM(p_g) AS p_g, SUM(p_gs IS NULL) as p_gs_incomplete, SUM(p_gs) AS p_gs, SUM(p_ip_outs) as p_ip_csk, SUM(p_ip_outs IS NULL) as p_ip_incomplete, SUM(p_ip_outs) DIV 3 + 0.1 * MOD(SUM(p_ip_outs),3) AS p_ip, SUM(p_pitches IS NULL) as p_pitches_incomplete, SUM(p_pitches) AS p_pitches, IF(SUM(p_gs_with_pitches) = 0, NULL, SUM(p_pitches_in_gs) / SUM(p_gs_with_pitches)) as p_pitches_per_start_csk, SUM(p_pitches_in_gs IS NULL)+SUM(p_gs_with_pitches IS NULL) as p_pitches_per_start_incomplete, ROUND(IF(SUM(p_gs_with_pitches) = 0, NULL, SUM(p_pitches_in_gs) / SUM(p_gs_with_pitches)),0) AS p_pitches_per_start, SUM(p_strikes IS NULL) as p_strikes_incomplete, SUM(p_strikes) AS p_strikes, IF(SUM(p_pitches) = 0, NULL, SUM(p_strikes) / SUM(p_pitches)) as p_strike_perc_csk, SUM(p_strikes IS NULL)+SUM(p_pitches IS NULL) as p_strike_perc_incomplete, ROUND(100 * (IF(SUM(p_pitches) = 0, NULL, SUM(p_strikes) / SUM(p_pitches))),2) AS p_strike_perc
FROM sup_player_team_seasons as st
  JOIN sup_people USING (person_id)
  JOIN sup_players USING (person_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN sup_comp_seasons USING (comp_id, year_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="post" 
GROUP BY person_id
HAVING p_g>0
ORDER BY person_id 

SQL PARAMS -- $VAR1 = [
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.00 seconds
Table Build Time: 0.03 seconds

Table Build Time: 0.03 seconds


--------------------------------------

h2h_sum_bat

Page Setup Time: 0.00182 seconds

WITH
  pgames AS (
SELECT person_id, game_id, team_id, year_id
FROM sup_team_games
  JOIN sup_player_games USING (game_id, team_id)
  JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE 1  
  ),
  pgames_list AS (
SELECT p1.game_id
FROM (SELECT game_id, team_id
FROM pgames
WHERE person_id=?  ) as p1
  JOIN (SELECT game_id, team_id FROM pgames WHERE person_id=?  ) as p2 ON p1.game_id=p2.game_id AND p1.team_id!=p2.team_id
  )
SELECT person_id, COUNT(*) AS b_games, SUM(b_pa) AS b_pa, SUM(b_ab) AS b_ab, SUM(b_r) AS b_r, SUM(b_h) AS b_h, SUM(b_doubles) AS b_doubles, SUM(b_triples) AS b_triples, SUM(b_hr) AS b_hr, SUM(b_rbi) AS b_rbi, SUM(b_sb) AS b_sb, SUM(b_cs) AS b_cs, SUM(b_bb) AS b_bb, SUM(b_so) AS b_so, IF(SUM(b_ab), SUM(b_h) / SUM(b_ab), NULL) as b_batting_avg_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab), SUM(b_h) / SUM(b_ab), NULL),3)) AS b_batting_avg, IF(SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL) as b_onbase_perc_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL),3)) AS b_onbase_perc, IF(SUM(b_ab), SUM(b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab), NULL) as b_slugging_perc_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab), SUM(b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab), NULL),3)) AS b_slugging_perc, IF(SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL) + IF(SUM(b_ab), SUM(b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab), NULL) as b_onbase_plus_slugging_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL) + IF(SUM(b_ab), SUM(b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab), NULL),3)) AS b_onbase_plus_slugging, SUM(b_h + b_doubles + 2 * b_triples + 3 * b_hr) AS b_tb, SUM(b_gidp) AS b_gidp, SUM(b_hbp) AS b_hbp, SUM(b_sh) AS b_sh, SUM(b_sf) AS b_sf, SUM(b_ibb) AS b_ibb
FROM sup_player_games as st
  JOIN (SELECT game_id, year_id, comp_id, phase_id, team_id, opp_team_id, opp_comp_id, opp_phase_id, team_game_num_season, home_away_neutral FROM sup_team_games) as tg USING (game_id, team_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN (SELECT team_id, year_id, name_abbr, name, link FROM sup_team_seasons GROUP BY team_id, year_id ) as ts USING (team_id, year_id)
  JOIN sup_games USING (game_id)
  JOIN pgames_list USING (game_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="reg" 
GROUP BY person_id LIMIT 0, 200

SQL PARAMS -- $VAR1 = [
          'trout-001mik',
          'urias-000jul',
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.03 seconds
WITH
  pgames AS (
SELECT person_id, game_id, team_id, year_id
FROM sup_team_games
  JOIN sup_player_games USING (game_id, team_id)
  JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE 1  
  ),
  pgames_list AS (
SELECT p1.game_id
FROM (SELECT game_id, team_id
FROM pgames
WHERE person_id=?  ) as p1
  JOIN (SELECT game_id, team_id FROM pgames WHERE person_id=?  ) as p2 ON p1.game_id=p2.game_id AND p1.team_id!=p2.team_id
  )
SELECT person_id, COUNT(*) AS b_games, SUM(b_pa) AS b_pa, SUM(b_ab) AS b_ab, SUM(b_r) AS b_r, SUM(b_h) AS b_h, SUM(b_doubles) AS b_doubles, SUM(b_triples) AS b_triples, SUM(b_hr) AS b_hr, SUM(b_rbi) AS b_rbi, SUM(b_sb) AS b_sb, SUM(b_cs) AS b_cs, SUM(b_bb) AS b_bb, SUM(b_so) AS b_so, IF(SUM(b_ab), SUM(b_h) / SUM(b_ab), NULL) as b_batting_avg_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab), SUM(b_h) / SUM(b_ab), NULL),3)) AS b_batting_avg, IF(SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL) as b_onbase_perc_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL),3)) AS b_onbase_perc, IF(SUM(b_ab), SUM(b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab), NULL) as b_slugging_perc_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab), SUM(b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab), NULL),3)) AS b_slugging_perc, IF(SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL) + IF(SUM(b_ab), SUM(b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab), NULL) as b_onbase_plus_slugging_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), SUM(b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / SUM(b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL) + IF(SUM(b_ab), SUM(b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab), NULL),3)) AS b_onbase_plus_slugging, SUM(b_h + b_doubles + 2 * b_triples + 3 * b_hr) AS b_tb, SUM(b_gidp) AS b_gidp, SUM(b_hbp) AS b_hbp, SUM(b_sh) AS b_sh, SUM(b_sf) AS b_sf, SUM(b_ibb) AS b_ibb
FROM sup_player_games as st
  JOIN (SELECT game_id, year_id, comp_id, phase_id, team_id, opp_team_id, opp_comp_id, opp_phase_id, team_game_num_season, home_away_neutral FROM sup_team_games) as tg USING (game_id, team_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN (SELECT team_id, year_id, name_abbr, name, link FROM sup_team_seasons GROUP BY team_id, year_id ) as ts USING (team_id, year_id)
  JOIN sup_games USING (game_id)
  JOIN pgames_list USING (game_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="post" 
GROUP BY person_id LIMIT 0, 200

SQL PARAMS -- $VAR1 = [
          'trout-001mik',
          'urias-000jul',
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.01 seconds
Table Build Time: 0.04 seconds


--------------------------------------

h2h_gamelogs_bat

Page Setup Time: 0.00264 seconds

WITH
  pgames AS (
SELECT person_id, game_id, team_id, year_id
FROM sup_team_games
  JOIN sup_player_games USING (game_id, team_id)
  JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE 1  
  ),
  pgames_list AS (
SELECT p1.game_id
FROM (SELECT game_id, team_id
FROM pgames
WHERE person_id=?  ) as p1
  JOIN (SELECT game_id, team_id FROM pgames WHERE person_id=?  ) as p2 ON p1.game_id=p2.game_id AND p1.team_id!=p2.team_id
  )
SELECT person_id, ts.name_abbr as team_name_abbr, ts.link as team_link, game_id, CONCAT(`date`,IF(date_game_number,CONCAT(" (",date_game_number,")"),"")) as date, sup_games.link as game_link, IF(b_games_started,"*","") AS b_games_started, (b_inning_last - b_inning_first) + 1 AS b_innings_played, b_lineup_position, b_pa, b_ab, b_r, b_h, b_doubles, b_triples, b_hr, b_rbi, b_sb, b_cs, b_bb, b_so, IF(b_ab, b_h / b_ab, NULL) as b_batting_avg_csk, TRIM(LEADING '0' FROM ROUND(IF(b_ab, b_h / b_ab, NULL),3)) AS b_batting_avg, IF((b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), (b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / (b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL) as b_onbase_perc_csk, TRIM(LEADING '0' FROM ROUND(IF((b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), (b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / (b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL),3)) AS b_onbase_perc, IF(b_ab, (b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / b_ab, NULL) as b_slugging_perc_csk, TRIM(LEADING '0' FROM ROUND(IF(b_ab, (b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / b_ab, NULL),3)) AS b_slugging_perc, IF((b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), (b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / (b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL) + IF(b_ab, (b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / b_ab, NULL) as b_onbase_plus_slugging_csk, TRIM(LEADING '0' FROM ROUND(IF((b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), (b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / (b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL) + IF(b_ab, (b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / b_ab, NULL),3)) AS b_onbase_plus_slugging, b_h + b_doubles + 2 * b_triples + 3 * b_hr AS b_tb, b_gidp, b_hbp, b_sh, b_sf, b_ibb, b_leverage_index_avg as b_leverage_index_avg_csk, ROUND(b_leverage_index_avg,2) AS b_leverage_index_avg, b_wpa as b_wpa_csk, ROUND(b_wpa,3) AS b_wpa, b_cli_avg as b_cli_avg_csk, ROUND(b_cli_avg,2) AS b_cli_avg, b_cwpa * 100 as b_cwpa_csk, ROUND(b_cwpa * 100,2) AS b_cwpa, b_baseout_runs as b_baseout_runs_csk, ROUND(b_baseout_runs,2) AS b_baseout_runs, b_draftkings_points as b_draftkings_points_csk, ROUND(b_draftkings_points,2) AS b_draftkings_points, b_fanduel_points as b_fanduel_points_csk, ROUND(b_fanduel_points,2) AS b_fanduel_points, 	SUBSTRING(CONCAT(
  IF(is_pinch_hitter,      ' PH',''),
  IF(is_pinch_runner,      ' PR',''),
  IF(is_shortstop,         ' SS',''),
  IF(is_catcher,           ' C', ''),
  IF(is_second_base,       ' 2B',''),
  IF(is_center_field,      ' CF',''),
  IF(is_third_base,        ' 3B',''),
  IF(is_right_field,       ' RF',''),
  IF(is_left_field,        ' LF',''),
  IF(is_first_base,        ' 1B',''),
  IF(is_pitcher,           ' P', ''),
  IF(is_designated_hitter, ' DH','')
  ),1)
  AS pos_game
FROM sup_player_games as st
  JOIN (SELECT game_id, year_id, comp_id, phase_id, team_id, opp_team_id, opp_comp_id, opp_phase_id, team_game_num_season, home_away_neutral FROM sup_team_games) as tg USING (game_id, team_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN (SELECT team_id, year_id, name_abbr, name, link FROM sup_team_seasons GROUP BY team_id, year_id ) as ts USING (team_id, year_id)
  JOIN sup_games USING (game_id)
  JOIN pgames_list USING (game_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="reg" 
ORDER BY date DESC, person_id LIMIT 0, 20

SQL PARAMS -- $VAR1 = [
          'trout-001mik',
          'urias-000jul',
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.03 seconds
WITH
  pgames AS (
SELECT person_id, game_id, team_id, year_id
FROM sup_team_games
  JOIN sup_player_games USING (game_id, team_id)
  JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE 1  
  ),
  pgames_list AS (
SELECT p1.game_id
FROM (SELECT game_id, team_id
FROM pgames
WHERE person_id=?  ) as p1
  JOIN (SELECT game_id, team_id FROM pgames WHERE person_id=?  ) as p2 ON p1.game_id=p2.game_id AND p1.team_id!=p2.team_id
  )
SELECT person_id, ts.name_abbr as team_name_abbr, ts.link as team_link, game_id, CONCAT(`date`,IF(date_game_number,CONCAT(" (",date_game_number,")"),"")) as date, sup_games.link as game_link, IF(b_games_started,"*","") AS b_games_started, (b_inning_last - b_inning_first) + 1 AS b_innings_played, b_lineup_position, b_pa, b_ab, b_r, b_h, b_doubles, b_triples, b_hr, b_rbi, b_sb, b_cs, b_bb, b_so, IF(b_ab, b_h / b_ab, NULL) as b_batting_avg_csk, TRIM(LEADING '0' FROM ROUND(IF(b_ab, b_h / b_ab, NULL),3)) AS b_batting_avg, IF((b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), (b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / (b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL) as b_onbase_perc_csk, TRIM(LEADING '0' FROM ROUND(IF((b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), (b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / (b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL),3)) AS b_onbase_perc, IF(b_ab, (b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / b_ab, NULL) as b_slugging_perc_csk, TRIM(LEADING '0' FROM ROUND(IF(b_ab, (b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / b_ab, NULL),3)) AS b_slugging_perc, IF((b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), (b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / (b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL) + IF(b_ab, (b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / b_ab, NULL) as b_onbase_plus_slugging_csk, TRIM(LEADING '0' FROM ROUND(IF((b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), (b_h + IFNULL(b_bb,0) + IFNULL(b_hbp,0)) / (b_ab + IFNULL(b_bb,0) + IFNULL(b_hbp,0) + IFNULL(b_sf,0)), NULL) + IF(b_ab, (b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / b_ab, NULL),3)) AS b_onbase_plus_slugging, b_h + b_doubles + 2 * b_triples + 3 * b_hr AS b_tb, b_gidp, b_hbp, b_sh, b_sf, b_ibb, b_leverage_index_avg as b_leverage_index_avg_csk, ROUND(b_leverage_index_avg,2) AS b_leverage_index_avg, b_wpa as b_wpa_csk, ROUND(b_wpa,3) AS b_wpa, b_cli_avg as b_cli_avg_csk, ROUND(b_cli_avg,2) AS b_cli_avg, b_cwpa * 100 as b_cwpa_csk, ROUND(b_cwpa * 100,2) AS b_cwpa, b_baseout_runs as b_baseout_runs_csk, ROUND(b_baseout_runs,2) AS b_baseout_runs, b_draftkings_points as b_draftkings_points_csk, ROUND(b_draftkings_points,2) AS b_draftkings_points, b_fanduel_points as b_fanduel_points_csk, ROUND(b_fanduel_points,2) AS b_fanduel_points, 	SUBSTRING(CONCAT(
  IF(is_pinch_hitter,      ' PH',''),
  IF(is_pinch_runner,      ' PR',''),
  IF(is_shortstop,         ' SS',''),
  IF(is_catcher,           ' C', ''),
  IF(is_second_base,       ' 2B',''),
  IF(is_center_field,      ' CF',''),
  IF(is_third_base,        ' 3B',''),
  IF(is_right_field,       ' RF',''),
  IF(is_left_field,        ' LF',''),
  IF(is_first_base,        ' 1B',''),
  IF(is_pitcher,           ' P', ''),
  IF(is_designated_hitter, ' DH','')
  ),1)
  AS pos_game
FROM sup_player_games as st
  JOIN (SELECT game_id, year_id, comp_id, phase_id, team_id, opp_team_id, opp_comp_id, opp_phase_id, team_game_num_season, home_away_neutral FROM sup_team_games) as tg USING (game_id, team_id)
  JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
  JOIN (SELECT team_id, year_id, name_abbr, name, link FROM sup_team_seasons GROUP BY team_id, year_id ) as ts USING (team_id, year_id)
  JOIN sup_games USING (game_id)
  JOIN pgames_list USING (game_id)
WHERE ((person_id=?) OR (person_id=?))
  AND type="post" 
ORDER BY date DESC, person_id LIMIT 0, 20

SQL PARAMS -- $VAR1 = [
          'trout-001mik',
          'urias-000jul',
          'urias-000jul',
          'trout-001mik'
        ];

Query Time: 0.01 seconds
Table Build Time: 0.05 seconds


--------------------------------------
SH->PARAM -- $VAR1 = {
          'player_id1' => 'trout-001mik',
          'player_id2' => 'urias-000jul',
          't2yrto' => 2025,
          't1yrto' => 2025,
          'match' => 'versus_playervplayer'
        };
SH->PARAM_NO_DEFAULT -- $VAR1 = {
          'player_id1' => 'trout-001mik',
          'player_id2' => 'urias-000jul'
        };
Show Criteria
Share Results

Search Criteria

Seasons
Player 1
Javascript is required for the selection of a player.
Choice is: Mike Trout 
Player 2
Javascript is required for the selection of a player.
Choice is: Julio Urías 
Player 3
Javascript is required for the selection of a player.
Player 4
Javascript is required for the selection of a player.
Player 5
Javascript is required for the selection of a player.
Player 6
Javascript is required for the selection of a player.
Team 1
Team 2

You have edited your search criteria

or keep editing your search

clear changes

Fetching Results

Stathead spinner

Mike Trout vs. Julio Urías

Regular Season: 4 PA , .250/.250/.250, 0 HR, 0 K

Playoffs: 0 PA

Mike Trout vs. Julio Urías: Batter vs. Pitcher

Mike Trout vs. Julio Urías: Year-by-Year Totals

Mike Trout vs. Julio Urías: Plate Appearances

Subscribe to Stathead Baseball for full results.

Go inside the Baseball Reference database and access the sports search engine that was made for fans like you. Subscriptions start at just $9/month. Learn More.

Get your first month FREE

Already a paid subscriber? Log in for full results.

Mike Trout vs. Julio Urías: Batting Comparison

Mike Trout vs. Julio Urías: Totals

Mike Trout vs. Julio Urías: Value

Mike Trout vs. Julio Urías: Sabermetric

Mike Trout vs. Julio Urías: Win Probability

Mike Trout vs. Julio Urías: Pitching Comparison

Mike Trout vs. Julio Urías: Totals

Mike Trout vs. Julio Urías: Value

Mike Trout vs. Julio Urías: Totals Against

Mike Trout vs. Julio Urías: Starting & Relieving

Mike Trout vs. Julio Urías: Ratios

Mike Trout vs. Julio Urías: Pitch Summary

Mike Trout vs. Julio Urías: Head-to-Head Batting

Mike Trout vs. Julio Urías: Totals

Mike Trout vs. Julio Urías: Game Logs

Subscribe to Stathead Baseball for full results.

Go inside the Baseball Reference database and access the sports search engine that was made for fans like you. Subscriptions start at just $9/month. Learn More.

Get your first month FREE

Already a paid subscriber? Log in for full results.

Data coverage:

Game data: Game data is only available for the American League, National League, and Federal League. Since 1901 for regular season data, since 1933 for the All-Star Game, and since 1903 for the Postseason.

Season data: Since 1871. Stats relying on play-by-play data are complete back to 1969, nearly complete back to 1950, and mostly complete back to 1912. Postseason data since 1903.

Please see our data coverage page for details.

If you utilize material unique to a Sports Reference site for a tweet, an article, or for research for a broadcast or podcast, please strongly consider citing this site as the source for the material. It would be greatly appreciated and would help us continue to produce this material.