Player Batting Span Stats Finder - Baseball

Find the best (or worst) spans for any number of games matching your criteria. • Video TutorialSample SearchesData Coverage
In a span of 5 games, in 2025, in the regular season, sorted by descending Home Runs.
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 »
--------------------------------------

main

Page Setup Time: 0.00213 seconds

WITH
  Gamelog AS (
SELECT person_id, year_id, team_id, FIRST_VALUE(IF(date_game_number,CONCAT(date," (",date_game_number,")"),date)) OVER w as span_start_date_window, LAST_VALUE(IF(date_game_number,CONCAT(date," (",date_game_number,")"),date)) OVER w as span_end_date_window, ROW_NUMBER() OVER w AS rn, COUNT(*) OVER w AS played_in_span, phase_id, SUM(b_hr) OVER w AS b_hr
FROM sup_player_games
  JOIN sup_games USING (game_id)
  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, 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)
WHERE sup_phase_seasons.type=?
  AND b_ab + IFNULL(b_sf,0) > 0
  AND year_id<=?
  AND year_id>=?
  AND date < current_date() 
WINDOW w AS (PARTITION BY person_id ORDER BY date, date_game_number ROWS BETWEEN 4 PRECEDING AND CURRENT ROW) 
  ),
  span_list AS (
SELECT person_id, played_in_span, span_start_date_window as span_start_date, span_end_date_window as span_end_date
FROM Gamelog
WHERE played_in_span=? 
GROUP BY person_id, span_start_date
ORDER BY b_hr DESC, span_start_date DESC LIMIT 0, 20
  )
SELECT name_display, name_display_csk, sup_players.link as name_display_link, person_id, MIN(age_on_day) as age_span_start, span_start_date as span_start_date_csk, span_start_date as span_start_date, span_end_date as span_end_date_csk, span_end_date as span_end_date, GROUP_CONCAT(DISTINCT UPPER(ts.name_abbr)) as teams_played_for_career, 'Games List' as details_games, YEAR(span_start_date) as year_min, 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, IF(SUM(b_ab), SUM(b_h + b_doubles + (2 * b_triples) + (3 * b_hr)) / SUM(b_ab), NULL) 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) as b_onbase_perc, IF(SUM(b_ab), SUM(b_h) / SUM(b_ab), NULL) as b_batting_avg, 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_hr IS NULL)+SUM(b_doubles IS NULL)+SUM(b_triples IS NULL)+SUM(b_h IS NULL) as b_singles_incomplete, SUM(b_h - (b_doubles + b_triples + b_hr)) AS b_singles, 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_ab IS NULL)+SUM(b_h 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_h IS NULL)+SUM(b_ab IS NULL)+SUM(b_triples IS NULL)+SUM(b_doubles 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, SUM(b_hbp IS NULL)+SUM(b_h IS NULL)+SUM(b_doubles IS NULL)+SUM(b_triples IS NULL)+SUM(b_bb IS NULL)+SUM(b_ab IS NULL)+SUM(b_sf IS NULL)+SUM(b_hr IS NULL) 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_doubles IS NULL)+SUM(b_triples IS NULL)+SUM(b_h IS NULL)+SUM(b_hr IS NULL) as b_tb_incomplete, SUM(b_h + b_doubles + 2 * b_triples + 3 * b_hr) 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 span_list
  JOIN sup_player_games as st USING (person_id)
  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, 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 (SELECT person_id, year_id, age as age_in_season, comp_id, phase_id, team_id FROM sup_player_team_seasons) as ps2 USING (person_id, year_id, comp_id, phase_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_abbr, name, link, comp_id, phase_id FROM sup_team_seasons) as ts USING (team_id, year_id, comp_id, phase_id)
WHERE sup_phase_seasons.type=?
  AND b_ab + IFNULL(b_sf,0) > 0
  AND CONCAT(`date`,IF(date_game_number,CONCAT(" (",date_game_number,")"),""))>=span_start_date
  AND CONCAT(`date`,IF(date_game_number,CONCAT(" (",date_game_number,")"),""))<=span_end_date 
GROUP BY person_id, span_start_date, span_end_date
ORDER BY b_hr DESC, span_start_date_csk DESC, person_id 

SQL PARAMS -- $VAR1 = [
          'reg',
          2025,
          2025,
          5,
          'reg'
        ];

Query Time: 1.21 seconds
Table Build Time: 0.05 seconds


--------------------------------------
SH->PARAM -- $VAR1 = {
          'comp_type' => 'reg',
          'max_temperature' => 120,
          'timeframe' => 'seasons',
          'playerapp' => 'oneab',
          'year_max' => 2025,
          'GF' => 'anyGF',
          'span_length' => 5,
          'max_wind_speed' => 90,
          'year_min' => 2025,
          'order_by' => 'b_hr',
          'exactness' => 'anymarked',
          'match' => 'player_span_game'
        };
SH->PARAM_NO_DEFAULT -- $VAR1 = {
          'year_min' => 2025,
          'year_max' => 2025
        };

Search Criteria

Click on the red text to pre-fill the form with various values

Sort By
Sorting options are only available for subscribers. Sign up now for a free trial.
Timeframe
Your search is currently looking for the individual games in the chosen span of days or seasons. You can also Switch to the search for totals from all games.
Your search is currently looking for the total of all games in the chosen span of days or seasons.
Game Type
Series/Game
Span Length
Games
Span Options
Player Appearance Official Rules
For consecutive hit and home run streaks only games where the batter had either an at bat or a sacrifice fly are considered.

For consecutive times on base streaks, generally, only games where the player had a plate appearance are considered.

Statistical Filters (PA, H, HR, RBI, etc.)

Player Filters (Team, League, Position, etc.)

Team
League

Note: Negro League game-level data is not yet available. See coverage note.

Age (as of day of game)

Days are optional. Leaving days blank will include entire year.

and
  days
to
and
  days
Bats
Throws
Batter's Defensive Position

Played the position at any point in the game

Starter or Reserve
Finished Game
Batting Order Position
On the Player's Birthday
Place of Birth/Death

Game Filters (Opponent, Location, etc.)

Opponent
Opponent's League

Note: Negro League game-level data is not yet available. See coverage note.

Game Result
Game Location
Ballpark
Game Length
Interleague Games
DH Rule in Effect
Temperature
to
Wind Speed
to
Wind Direction
Precipitation
Sky
Day or Night

You have edited your search criteria

or keep editing your search

clear changes

Fetching Results

Stathead spinner

Please note that Span Finder searches are particularly data intensive and can take up to 1-2 minutes to complete

Query Results

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: 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.