Minnesota Timberwolves vs. Toronto Raptors: Head-to-Head Reg Season and Playoffs Stats Comparison
--------------------------------------
header_comp
WITH
t1 AS (
SELECT team_id, SUM(win AND type="reg") as rsw, SUM(loss AND type="reg") as rsl, SUM(tie AND type="reg") as rst, SUM(win AND type="post") as pow, SUM(loss AND type="post") as pol
FROM sup_team_games
JOIN sup_games USING (game_id)
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE (team_id=?)
AND opp_team_id=?
),
t2 AS (
SELECT team_id, SUM(win AND type="reg") as rsw, SUM(loss AND type="reg") as rsl, SUM(tie AND type="reg") as rst, SUM(win AND type="post") as pow, SUM(loss AND type="post") as pol
FROM sup_team_games
JOIN sup_games USING (game_id)
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE (team_id=?)
AND opp_team_id=?
)
SELECT team_id, rs_wins, rs_losses, rs_ties, po_wins, po_losses, SUM(games) AS games, SUM(wins) AS wins, SUM(losses) AS losses, SUM(wins) / SUM(wins + losses) as win_loss_pct_csk, TRIM(LEADING '0' FROM ROUND(SUM(wins) / SUM(wins + losses),3)) AS win_loss_pct, SUM(pts)/SUM(games) as team_ppg_csk, ROUND(SUM(pts)/SUM(games),1) AS team_ppg, SUM(opp_pts)/SUM(games) as team_oppg_csk, ROUND(SUM(opp_pts)/SUM(games),1) AS team_oppg, SUM(is_playoff_team) AS is_playoff_team, SUM(is_finals_team) AS is_conf_champ, SUM(is_lg_champ) AS is_lg_champ
FROM sup_team_seasons as ts
JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
JOIN sup_comp_seasons USING (comp_id, year_id)
LEFT JOIN (SELECT t1.team_id, t1.rsw as rs_wins, t1.rsl as rs_losses, t1.rst as rs_ties, t1.pow as po_wins, t1.pol as po_losses FROM t1
UNION SELECT t2.team_id, t2.rsw as rs_wins, t2.rsl as rs_losses, t2.rst as rs_ties, t2.pow as po_wins, t2.pol as po_losses
FROM t2) as xxx USING (team_id)
WHERE ((team_id=?) OR (team_id=?))
AND type="reg"
GROUP BY team_id
ORDER BY team_id
SQL PARAMS -- $VAR1 = [
'MIN',
'TOR',
'TOR',
'MIN',
'TOR',
'MIN'
];
--------------------------------------
h2h_gamelogs
Page Setup Time: 0.00080 seconds
SELECT IF(away_team_id="MIN","@","") as loc, IF(away_team_id="MIN",away_score,home_score) as team1_score, IF(away_team_id="TOR",away_score,home_score) as team2_score, game_id, date, game_id, sup_games.link as game_link, sup_venue_seasons.name as venue_name, city as venue_city, IF(overtimes, IF(overtimes>1, CONCAT(overtimes,"OT"), "OT"), "") as overtimes
FROM sup_games
JOIN (SELECT game_id, year_id, comp_id, phase_id, team_id as away_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, away_team_id)
JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
LEFT JOIN sup_venues USING (venue_id)
LEFT JOIN sup_venue_seasons USING (venue_id, year_id)
WHERE ((away_team_id=? AND home_team_id=?) OR (away_team_id=? AND home_team_id=?))
AND home_score IS NOT NULL
AND type="reg"
ORDER BY date DESC LIMIT 0, 20
SQL PARAMS -- $VAR1 = [
'MIN',
'TOR',
'TOR',
'MIN'
];
Query Time: 0.03 seconds
SELECT IF(away_team_id="MIN","@","") as loc, IF(away_team_id="MIN",away_score,home_score) as team1_score, IF(away_team_id="TOR",away_score,home_score) as team2_score, game_id, date, game_id, sup_games.link as game_link, sup_venue_seasons.name as venue_name, city as venue_city, IF(overtimes, IF(overtimes>1, CONCAT(overtimes,"OT"), "OT"), "") as overtimes
FROM sup_games
JOIN (SELECT game_id, year_id, comp_id, phase_id, team_id as away_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, away_team_id)
JOIN sup_phase_seasons USING (comp_id, phase_id, year_id)
LEFT JOIN sup_venues USING (venue_id)
LEFT JOIN sup_venue_seasons USING (venue_id, year_id)
WHERE ((away_team_id=? AND home_team_id=?) OR (away_team_id=? AND home_team_id=?))
AND home_score IS NOT NULL
AND type="post"
ORDER BY date DESC LIMIT 0, 20
SQL PARAMS -- $VAR1 = [
'MIN',
'TOR',
'TOR',
'MIN'
];
Query Time: 0.17 seconds
Table Build Time: 0.06 seconds
Column 'comp_id' in field list is ambiguous
WITH
tr1 AS (
SELECT year_id, comp_id, COUNT(*) AS games, SUM(win=1) AS wins, SUM(loss=1) AS losses, SUM(pts) AS pts, SUM(pts)/COUNT(*) as team_ppg_csk, ROUND(SUM(pts)/COUNT(*),1) AS team_ppg
FROM sup_team_games
JOIN sup_games USING (game_id)
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE (team_id=?)
AND opp_team_id=?
AND type="reg"
GROUP BY year_id
),
tr2 AS (
SELECT year_id, comp_id, COUNT(*) AS games, SUM(win=1) AS wins, SUM(loss=1) AS losses, SUM(pts) AS pts, SUM(pts)/COUNT(*) as team_ppg_csk, ROUND(SUM(pts)/COUNT(*),1) AS team_ppg
FROM sup_team_games
JOIN sup_games USING (game_id)
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE (team_id=?)
AND opp_team_id=?
AND type="reg"
GROUP BY year_id
)
SELECT year_id as year_id_csk, IF(comp_id="WNBA", year_id, CONCAT(year_id-1,"-",SUBSTRING(year_id,3,2))) as year_id, tr1.comp_id, tr1.games AS tr1_games, tr2.games AS tr2_games, tr1.wins AS tr1_wins, tr2.wins AS tr2_wins, tr1.losses AS tr1_losses, tr2.losses AS tr2_losses, tr1.pts AS tr1_pts, tr2.pts AS tr2_pts, tr1.team_ppg AS tr1_team_ppg, tr2.team_ppg AS tr2_team_ppg
FROM tr1
JOIN tr2 USING (year_id)
WHERE 1
GROUP BY year_id
ORDER BY year_id
--------------------------------------
h2h_per_game
Page Setup Time: 0.00436 seconds
WITH
t1gms AS (
SELECT game_id
FROM sup_team_games
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE (team_id=?)
AND type="reg"
),
t2gms AS (
SELECT game_id
FROM sup_team_games
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE (team_id=?)
AND type="reg"
)
SELECT (SELECT name_abbr FROM sup_team_seasons WHERE team_id=st.team_id AND sup_team_seasons.year_id=MAX(st.year_id) LIMIT 1) as franch_abbr, team_id, MIN(year_id) as year_min_csk, IF(comp_id='WNBA', MIN(year_id), CONCAT_WS('-', (MIN(year_id) - 1), RIGHT(MIN(year_id), 2))) as year_min, MAX(year_id) as year_max_csk, IF(comp_id='WNBA', MAX(year_id), CONCAT_WS('-', (MAX(year_id) - 1), RIGHT(MAX(year_id), 2))) as year_max, (SUM(fg))/(COUNT(*)) as fg_per_g_csk, ROUND((SUM(fg))/(COUNT(*)),1) AS fg_per_g, (SUM(fga))/(COUNT(*)) as fga_per_g_csk, ROUND((SUM(fga))/(COUNT(*)),1) AS fga_per_g, IF(SUM(fga), SUM((fga IS NOT NULL) * fg) / SUM(fga), NULL) as fg_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga), SUM((fga IS NOT NULL) * fg) / SUM(fga), NULL),3)) AS fg_pct, (SUM(fg)/(COUNT(*)) - IFNULL(SUM(fg3 * (fg IS NOT NULL))/(COUNT(*)-SUM(fg IS NULL)), 0)) as fg2_per_g_csk, ROUND((SUM(fg)/(COUNT(*)) - IFNULL(SUM(fg3 * (fg IS NOT NULL))/(COUNT(*)-SUM(fg IS NULL)), 0)),1) AS fg2_per_g, (SUM(fga)/(COUNT(*)) - IFNULL(SUM(fg3a * (fga IS NOT NULL))/(COUNT(*)-SUM(fga IS NULL)), 0)) as fg2a_per_g_csk, ROUND((SUM(fga)/(COUNT(*)) - IFNULL(SUM(fg3a * (fga IS NOT NULL))/(COUNT(*)-SUM(fga IS NULL)), 0)),1) AS fg2a_per_g, IF(SUM(fga - IFNULL(fg3a, 0)), SUM(((fga - IFNULL(fg3a, 0)) IS NOT NULL) * (fg - IFNULL(fg3, 0))) / SUM(fga - IFNULL(fg3a, 0)), NULL) as fg2_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga - IFNULL(fg3a, 0)), SUM(((fga - IFNULL(fg3a, 0)) IS NOT NULL) * (fg - IFNULL(fg3, 0))) / SUM(fga - IFNULL(fg3a, 0)), NULL),3)) AS fg2_pct, (SUM(fg3))/((COUNT(*)-SUM(fg3 IS NULL))) as fg3_per_g_csk, ROUND((SUM(fg3))/((COUNT(*)-SUM(fg3 IS NULL))),1) AS fg3_per_g, (SUM(fg3a))/((COUNT(*)-SUM(fg3a IS NULL))) as fg3a_per_g_csk, ROUND((SUM(fg3a))/((COUNT(*)-SUM(fg3a IS NULL))),1) AS fg3a_per_g, IF(SUM(fg3a), SUM((fg3a IS NOT NULL) * fg3) / SUM(fg3a), NULL) as fg3_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fg3a), SUM((fg3a IS NOT NULL) * fg3) / SUM(fg3a), NULL),3)) AS fg3_pct, IF(SUM(fga), SUM(fg + 0.5 * IFNULL(fg3, 0)) / SUM(fga), NULL) as efg_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga), SUM(fg + 0.5 * IFNULL(fg3, 0)) / SUM(fga), NULL),3)) AS efg_pct, (SUM(ft))/(COUNT(*)) as ft_per_g_csk, ROUND((SUM(ft))/(COUNT(*)),1) AS ft_per_g, (SUM(fta))/((COUNT(*)-SUM(fta IS NULL))) as fta_per_g_csk, ROUND((SUM(fta))/((COUNT(*)-SUM(fta IS NULL))),1) AS fta_per_g, IF(SUM(fta), SUM(ft) / SUM(fta), NULL) as ft_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fta), SUM(ft) / SUM(fta), NULL),3)) AS ft_pct, (SUM(orb))/((COUNT(*)-SUM(orb IS NULL))) as orb_per_g_csk, ROUND((SUM(orb))/((COUNT(*)-SUM(orb IS NULL))),1) AS orb_per_g, (SUM(trb * (orb IS NOT NULL))/(COUNT(*)-SUM(orb IS NULL)) - SUM(orb * (orb IS NOT NULL))/(COUNT(*)-SUM(orb IS NULL))) as drb_per_g_csk, ROUND((SUM(trb * (orb IS NOT NULL))/(COUNT(*)-SUM(orb IS NULL)) - SUM(orb * (orb IS NOT NULL))/(COUNT(*)-SUM(orb IS NULL))),1) AS drb_per_g, (SUM(trb))/((COUNT(*)-SUM(trb IS NULL))) as trb_per_g_csk, ROUND((SUM(trb))/((COUNT(*)-SUM(trb IS NULL))),1) AS trb_per_g, (SUM(ast))/((COUNT(*)-SUM(ast IS NULL))) as ast_per_g_csk, ROUND((SUM(ast))/((COUNT(*)-SUM(ast IS NULL))),1) AS ast_per_g, (SUM(stl))/((COUNT(*)-SUM(stl IS NULL))) as stl_per_g_csk, ROUND((SUM(stl))/((COUNT(*)-SUM(stl IS NULL))),1) AS stl_per_g, (SUM(blk))/((COUNT(*)-SUM(blk IS NULL))) as blk_per_g_csk, ROUND((SUM(blk))/((COUNT(*)-SUM(blk IS NULL))),1) AS blk_per_g, (SUM(tov))/((COUNT(*)-SUM(tov IS NULL))) as tov_per_g_csk, ROUND((SUM(tov))/((COUNT(*)-SUM(tov IS NULL))),1) AS tov_per_g, (SUM(pf))/((COUNT(*)-SUM(pf IS NULL))) as pf_per_g_csk, ROUND((SUM(pf))/((COUNT(*)-SUM(pf IS NULL))),1) AS pf_per_g, (SUM(pts))/(COUNT(*)) as pts_per_g_csk, ROUND((SUM(pts))/(COUNT(*)),1) AS pts_per_g
FROM sup_team_games as st
JOIN sup_games USING (game_id)
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
JOIN t1gms USING (game_id)
JOIN t2gms USING (game_id)
WHERE home_score IS NOT NULL
GROUP BY team_id LIMIT 0, 200
SQL PARAMS -- $VAR1 = [
'MIN',
'TOR'
];
Query Time: 0.04 seconds
WITH
t1gms AS (
SELECT game_id
FROM sup_team_games
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE (team_id=?)
AND type="post"
),
t2gms AS (
SELECT game_id
FROM sup_team_games
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE (team_id=?)
AND type="post"
)
SELECT (SELECT name_abbr FROM sup_team_seasons WHERE team_id=st.team_id AND sup_team_seasons.year_id=MAX(st.year_id) LIMIT 1) as franch_abbr, team_id, MIN(year_id) as year_min_csk, IF(comp_id='WNBA', MIN(year_id), CONCAT_WS('-', (MIN(year_id) - 1), RIGHT(MIN(year_id), 2))) as year_min, MAX(year_id) as year_max_csk, IF(comp_id='WNBA', MAX(year_id), CONCAT_WS('-', (MAX(year_id) - 1), RIGHT(MAX(year_id), 2))) as year_max, (SUM(fg))/(COUNT(*)) as fg_per_g_csk, ROUND((SUM(fg))/(COUNT(*)),1) AS fg_per_g, (SUM(fga))/(COUNT(*)) as fga_per_g_csk, ROUND((SUM(fga))/(COUNT(*)),1) AS fga_per_g, IF(SUM(fga), SUM((fga IS NOT NULL) * fg) / SUM(fga), NULL) as fg_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga), SUM((fga IS NOT NULL) * fg) / SUM(fga), NULL),3)) AS fg_pct, (SUM(fg)/(COUNT(*)) - IFNULL(SUM(fg3 * (fg IS NOT NULL))/(COUNT(*)-SUM(fg IS NULL)), 0)) as fg2_per_g_csk, ROUND((SUM(fg)/(COUNT(*)) - IFNULL(SUM(fg3 * (fg IS NOT NULL))/(COUNT(*)-SUM(fg IS NULL)), 0)),1) AS fg2_per_g, (SUM(fga)/(COUNT(*)) - IFNULL(SUM(fg3a * (fga IS NOT NULL))/(COUNT(*)-SUM(fga IS NULL)), 0)) as fg2a_per_g_csk, ROUND((SUM(fga)/(COUNT(*)) - IFNULL(SUM(fg3a * (fga IS NOT NULL))/(COUNT(*)-SUM(fga IS NULL)), 0)),1) AS fg2a_per_g, IF(SUM(fga - IFNULL(fg3a, 0)), SUM(((fga - IFNULL(fg3a, 0)) IS NOT NULL) * (fg - IFNULL(fg3, 0))) / SUM(fga - IFNULL(fg3a, 0)), NULL) as fg2_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga - IFNULL(fg3a, 0)), SUM(((fga - IFNULL(fg3a, 0)) IS NOT NULL) * (fg - IFNULL(fg3, 0))) / SUM(fga - IFNULL(fg3a, 0)), NULL),3)) AS fg2_pct, (SUM(fg3))/((COUNT(*)-SUM(fg3 IS NULL))) as fg3_per_g_csk, ROUND((SUM(fg3))/((COUNT(*)-SUM(fg3 IS NULL))),1) AS fg3_per_g, (SUM(fg3a))/((COUNT(*)-SUM(fg3a IS NULL))) as fg3a_per_g_csk, ROUND((SUM(fg3a))/((COUNT(*)-SUM(fg3a IS NULL))),1) AS fg3a_per_g, IF(SUM(fg3a), SUM((fg3a IS NOT NULL) * fg3) / SUM(fg3a), NULL) as fg3_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fg3a), SUM((fg3a IS NOT NULL) * fg3) / SUM(fg3a), NULL),3)) AS fg3_pct, IF(SUM(fga), SUM(fg + 0.5 * IFNULL(fg3, 0)) / SUM(fga), NULL) as efg_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga), SUM(fg + 0.5 * IFNULL(fg3, 0)) / SUM(fga), NULL),3)) AS efg_pct, (SUM(ft))/(COUNT(*)) as ft_per_g_csk, ROUND((SUM(ft))/(COUNT(*)),1) AS ft_per_g, (SUM(fta))/((COUNT(*)-SUM(fta IS NULL))) as fta_per_g_csk, ROUND((SUM(fta))/((COUNT(*)-SUM(fta IS NULL))),1) AS fta_per_g, IF(SUM(fta), SUM(ft) / SUM(fta), NULL) as ft_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fta), SUM(ft) / SUM(fta), NULL),3)) AS ft_pct, (SUM(orb))/((COUNT(*)-SUM(orb IS NULL))) as orb_per_g_csk, ROUND((SUM(orb))/((COUNT(*)-SUM(orb IS NULL))),1) AS orb_per_g, (SUM(trb * (orb IS NOT NULL))/(COUNT(*)-SUM(orb IS NULL)) - SUM(orb * (orb IS NOT NULL))/(COUNT(*)-SUM(orb IS NULL))) as drb_per_g_csk, ROUND((SUM(trb * (orb IS NOT NULL))/(COUNT(*)-SUM(orb IS NULL)) - SUM(orb * (orb IS NOT NULL))/(COUNT(*)-SUM(orb IS NULL))),1) AS drb_per_g, (SUM(trb))/((COUNT(*)-SUM(trb IS NULL))) as trb_per_g_csk, ROUND((SUM(trb))/((COUNT(*)-SUM(trb IS NULL))),1) AS trb_per_g, (SUM(ast))/((COUNT(*)-SUM(ast IS NULL))) as ast_per_g_csk, ROUND((SUM(ast))/((COUNT(*)-SUM(ast IS NULL))),1) AS ast_per_g, (SUM(stl))/((COUNT(*)-SUM(stl IS NULL))) as stl_per_g_csk, ROUND((SUM(stl))/((COUNT(*)-SUM(stl IS NULL))),1) AS stl_per_g, (SUM(blk))/((COUNT(*)-SUM(blk IS NULL))) as blk_per_g_csk, ROUND((SUM(blk))/((COUNT(*)-SUM(blk IS NULL))),1) AS blk_per_g, (SUM(tov))/((COUNT(*)-SUM(tov IS NULL))) as tov_per_g_csk, ROUND((SUM(tov))/((COUNT(*)-SUM(tov IS NULL))),1) AS tov_per_g, (SUM(pf))/((COUNT(*)-SUM(pf IS NULL))) as pf_per_g_csk, ROUND((SUM(pf))/((COUNT(*)-SUM(pf IS NULL))),1) AS pf_per_g, (SUM(pts))/(COUNT(*)) as pts_per_g_csk, ROUND((SUM(pts))/(COUNT(*)),1) AS pts_per_g
FROM sup_team_games as st
JOIN sup_games USING (game_id)
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
JOIN t1gms USING (game_id)
JOIN t2gms USING (game_id)
WHERE home_score IS NOT NULL
GROUP BY team_id LIMIT 0, 200
SQL PARAMS -- $VAR1 = [
'MIN',
'TOR'
];
Query Time: 0.02 seconds
Table Build Time: 0.03 seconds
--------------------------------------
h2h_sum
Page Setup Time: 0.00112 seconds
WITH
t1gms AS (
SELECT game_id
FROM sup_team_games
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE (team_id=?)
AND type="reg"
),
t2gms AS (
SELECT game_id
FROM sup_team_games
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE (team_id=?)
AND type="reg"
)
SELECT (SELECT name_abbr FROM sup_team_seasons WHERE team_id=st.team_id AND sup_team_seasons.year_id=MAX(st.year_id) LIMIT 1) as franch_abbr, team_id, MIN(year_id) as year_min_csk, IF(comp_id='WNBA', MIN(year_id), CONCAT_WS('-', (MIN(year_id) - 1), RIGHT(MIN(year_id), 2))) as year_min, MAX(year_id) as year_max_csk, IF(comp_id='WNBA', MAX(year_id), CONCAT_WS('-', (MAX(year_id) - 1), RIGHT(MAX(year_id), 2))) as year_max, SUM(win=1) AS wins, SUM(loss=1) AS losses, COUNT(*) AS games, SUM(fg) AS fg, SUM(fga) AS fga, IF(SUM(fga), SUM((fga IS NOT NULL) * fg) / SUM(fga), NULL) as fg_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga), SUM((fga IS NOT NULL) * fg) / SUM(fga), NULL),3)) AS fg_pct, SUM(fg - IFNULL(fg3, 0)) AS fg2, SUM(fga - IFNULL(fg3a, 0)) AS fg2a, IF(SUM(fga - IFNULL(fg3a, 0)), SUM(((fga - IFNULL(fg3a, 0)) IS NOT NULL) * (fg - IFNULL(fg3, 0))) / SUM(fga - IFNULL(fg3a, 0)), NULL) as fg2_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga - IFNULL(fg3a, 0)), SUM(((fga - IFNULL(fg3a, 0)) IS NOT NULL) * (fg - IFNULL(fg3, 0))) / SUM(fga - IFNULL(fg3a, 0)), NULL),3)) AS fg2_pct, SUM(fg3) AS fg3, SUM(fg3a) AS fg3a, IF(SUM(fg3a), SUM((fg3a IS NOT NULL) * fg3) / SUM(fg3a), NULL) as fg3_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fg3a), SUM((fg3a IS NOT NULL) * fg3) / SUM(fg3a), NULL),3)) AS fg3_pct, IF(SUM(fga), SUM(fg + 0.5 * IFNULL(fg3, 0)) / SUM(fga), NULL) as efg_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga), SUM(fg + 0.5 * IFNULL(fg3, 0)) / SUM(fga), NULL),3)) AS efg_pct, SUM(ft) AS ft, SUM(fta) AS fta, IF(SUM(fta), SUM(ft) / SUM(fta), NULL) as ft_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fta), SUM(ft) / SUM(fta), NULL),3)) AS ft_pct, SUM(orb) AS orb, SUM(trb - orb) AS drb, SUM(trb) AS trb, SUM(ast) AS ast, SUM(stl) AS stl, SUM(blk) AS blk, SUM(tov) AS tov, SUM(pf) AS pf, SUM(pts) AS pts
FROM sup_team_games as st
JOIN sup_games USING (game_id)
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
JOIN t1gms USING (game_id)
JOIN t2gms USING (game_id)
WHERE home_score IS NOT NULL
GROUP BY team_id LIMIT 0, 200
SQL PARAMS -- $VAR1 = [
'MIN',
'TOR'
];
Query Time: 0.04 seconds
WITH
t1gms AS (
SELECT game_id
FROM sup_team_games
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE (team_id=?)
AND type="post"
),
t2gms AS (
SELECT game_id
FROM sup_team_games
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE (team_id=?)
AND type="post"
)
SELECT (SELECT name_abbr FROM sup_team_seasons WHERE team_id=st.team_id AND sup_team_seasons.year_id=MAX(st.year_id) LIMIT 1) as franch_abbr, team_id, MIN(year_id) as year_min_csk, IF(comp_id='WNBA', MIN(year_id), CONCAT_WS('-', (MIN(year_id) - 1), RIGHT(MIN(year_id), 2))) as year_min, MAX(year_id) as year_max_csk, IF(comp_id='WNBA', MAX(year_id), CONCAT_WS('-', (MAX(year_id) - 1), RIGHT(MAX(year_id), 2))) as year_max, SUM(win=1) AS wins, SUM(loss=1) AS losses, COUNT(*) AS games, SUM(fg) AS fg, SUM(fga) AS fga, IF(SUM(fga), SUM((fga IS NOT NULL) * fg) / SUM(fga), NULL) as fg_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga), SUM((fga IS NOT NULL) * fg) / SUM(fga), NULL),3)) AS fg_pct, SUM(fg - IFNULL(fg3, 0)) AS fg2, SUM(fga - IFNULL(fg3a, 0)) AS fg2a, IF(SUM(fga - IFNULL(fg3a, 0)), SUM(((fga - IFNULL(fg3a, 0)) IS NOT NULL) * (fg - IFNULL(fg3, 0))) / SUM(fga - IFNULL(fg3a, 0)), NULL) as fg2_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga - IFNULL(fg3a, 0)), SUM(((fga - IFNULL(fg3a, 0)) IS NOT NULL) * (fg - IFNULL(fg3, 0))) / SUM(fga - IFNULL(fg3a, 0)), NULL),3)) AS fg2_pct, SUM(fg3) AS fg3, SUM(fg3a) AS fg3a, IF(SUM(fg3a), SUM((fg3a IS NOT NULL) * fg3) / SUM(fg3a), NULL) as fg3_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fg3a), SUM((fg3a IS NOT NULL) * fg3) / SUM(fg3a), NULL),3)) AS fg3_pct, IF(SUM(fga), SUM(fg + 0.5 * IFNULL(fg3, 0)) / SUM(fga), NULL) as efg_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga), SUM(fg + 0.5 * IFNULL(fg3, 0)) / SUM(fga), NULL),3)) AS efg_pct, SUM(ft) AS ft, SUM(fta) AS fta, IF(SUM(fta), SUM(ft) / SUM(fta), NULL) as ft_pct_csk, TRIM(LEADING '0' FROM ROUND(IF(SUM(fta), SUM(ft) / SUM(fta), NULL),3)) AS ft_pct, SUM(orb) AS orb, SUM(trb - orb) AS drb, SUM(trb) AS trb, SUM(ast) AS ast, SUM(stl) AS stl, SUM(blk) AS blk, SUM(tov) AS tov, SUM(pf) AS pf, SUM(pts) AS pts
FROM sup_team_games as st
JOIN sup_games USING (game_id)
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
JOIN t1gms USING (game_id)
JOIN t2gms USING (game_id)
WHERE home_score IS NOT NULL
GROUP BY team_id LIMIT 0, 200
SQL PARAMS -- $VAR1 = [
'MIN',
'TOR'
];
Query Time: 0.01 seconds
Table Build Time: 0.03 seconds
--------------------------------------
overall_per_game
Page Setup Time: 0.00443 seconds
SELECT (SELECT name_abbr FROM sup_team_seasons WHERE team_id=st.team_id AND sup_team_seasons.year_id=MAX(st.year_id) LIMIT 1) as franch_abbr, team_id, MIN(year_id) as year_min_csk, IF(comp_id='WNBA', MIN(year_id), CONCAT_WS('-', (MIN(year_id) - 1), RIGHT(MIN(year_id), 2))) as year_min, MAX(year_id) as year_max_csk, IF(comp_id='WNBA', MAX(year_id), CONCAT_WS('-', (MAX(year_id) - 1), RIGHT(MAX(year_id), 2))) as year_max, (SUM(fg))/(SUM(games)) as fg_per_season_csk, SUM(fg IS NULL) as fg_per_season_incomplete, ROUND((SUM(fg))/(SUM(games)),1) AS fg_per_season, (SUM(fga))/(SUM(games)) as fga_per_season_csk, SUM(fga IS NULL) as fga_per_season_incomplete, ROUND((SUM(fga))/(SUM(games)),1) AS fga_per_season, IF(SUM(fga), SUM(fg) / SUM(fga), NULL) as fg_pct_csk, SUM(fga IS NULL)+SUM(fg IS NULL) as fg_pct_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga), SUM(fg) / SUM(fga), NULL),3)) AS fg_pct, (SUM(fg)/(SUM(games)) - IFNULL(SUM(fg3 * (fg IS NOT NULL))/SUM(games*(fg IS NOT NULL)), 0)) as fg2_per_season_csk, NULL as fg2_per_season_incomplete, ROUND((SUM(fg)/(SUM(games)) - IFNULL(SUM(fg3 * (fg IS NOT NULL))/SUM(games*(fg IS NOT NULL)), 0)),1) AS fg2_per_season, (SUM(fga)/(SUM(games)) - IFNULL(SUM(fg3a * (fga IS NOT NULL))/SUM(games*(fga IS NOT NULL)), 0)) as fg2a_per_season_csk, NULL as fg2a_per_season_incomplete, ROUND((SUM(fga)/(SUM(games)) - IFNULL(SUM(fg3a * (fga IS NOT NULL))/SUM(games*(fga IS NOT NULL)), 0)),1) AS fg2a_per_season, SUM(fg - IFNULL(fg3, 0)) / SUM(fga - IFNULL(fg3a, 0)) as fg2_pct_csk, NULL as fg2_pct_incomplete, TRIM(LEADING '0' FROM ROUND(SUM(fg - IFNULL(fg3, 0)) / SUM(fga - IFNULL(fg3a, 0)),3)) AS fg2_pct, (SUM(fg3))/(SUM(games*(fg3 IS NOT NULL))) as fg3_per_season_csk, NULL as fg3_per_season_incomplete, ROUND((SUM(fg3))/(SUM(games*(fg3 IS NOT NULL))),1) AS fg3_per_season, (SUM(fg3a))/(SUM(games*(fg3a IS NOT NULL))) as fg3a_per_season_csk, NULL as fg3a_per_season_incomplete, ROUND((SUM(fg3a))/(SUM(games*(fg3a IS NOT NULL))),1) AS fg3a_per_season, IF(SUM(fg3a), SUM(fg3) / SUM(fg3a), NULL) as fg3_pct_csk, NULL as fg3_pct_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(fg3a), SUM(fg3) / SUM(fg3a), NULL),3)) AS fg3_pct, IF(SUM(fga), SUM(fg + 0.5 * IFNULL(fg3, 0)) / SUM(fga), NULL) as efg_pct_csk, NULL as efg_pct_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga), SUM(fg + 0.5 * IFNULL(fg3, 0)) / SUM(fga), NULL),3)) AS efg_pct, (SUM(ft))/(SUM(games)) as ft_per_season_csk, SUM(ft IS NULL) as ft_per_season_incomplete, ROUND((SUM(ft))/(SUM(games)),1) AS ft_per_season, (SUM(fta))/(SUM(games*(fta IS NOT NULL))) as fta_per_season_csk, SUM(fta IS NULL) as fta_per_season_incomplete, ROUND((SUM(fta))/(SUM(games*(fta IS NOT NULL))),1) AS fta_per_season, IF(SUM(fta), SUM(ft) / SUM(fta), NULL) as ft_pct_csk, SUM(fta IS NULL)+SUM(ft IS NULL) as ft_pct_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(fta), SUM(ft) / SUM(fta), NULL),3)) AS ft_pct, (SUM(orb))/(SUM(games*(orb IS NOT NULL))) as orb_per_season_csk, SUM(orb IS NULL) as orb_per_season_incomplete, ROUND((SUM(orb))/(SUM(games*(orb IS NOT NULL))),1) AS orb_per_season, (SUM(trb * (orb IS NOT NULL))/SUM(games*(orb IS NOT NULL)) - SUM(orb * (orb IS NOT NULL))/SUM(games*(orb IS NOT NULL))) as drb_per_season_csk, SUM(orb IS NULL)+SUM(trb IS NULL) as drb_per_season_incomplete, ROUND((SUM(trb * (orb IS NOT NULL))/SUM(games*(orb IS NOT NULL)) - SUM(orb * (orb IS NOT NULL))/SUM(games*(orb IS NOT NULL))),1) AS drb_per_season, (SUM(trb))/(SUM(games*(trb IS NOT NULL))) as trb_per_season_csk, SUM(trb IS NULL) as trb_per_season_incomplete, ROUND((SUM(trb))/(SUM(games*(trb IS NOT NULL))),1) AS trb_per_season, (SUM(ast))/(SUM(games*(ast IS NOT NULL))) as ast_per_season_csk, SUM(ast IS NULL) as ast_per_season_incomplete, ROUND((SUM(ast))/(SUM(games*(ast IS NOT NULL))),1) AS ast_per_season, (SUM(stl))/(SUM(games*(stl IS NOT NULL))) as stl_per_season_csk, SUM(stl IS NULL) as stl_per_season_incomplete, ROUND((SUM(stl))/(SUM(games*(stl IS NOT NULL))),1) AS stl_per_season, (SUM(blk))/(SUM(games*(blk IS NOT NULL))) as blk_per_season_csk, SUM(blk IS NULL) as blk_per_season_incomplete, ROUND((SUM(blk))/(SUM(games*(blk IS NOT NULL))),1) AS blk_per_season, (SUM(tov))/(SUM(games*(tov IS NOT NULL))) as tov_per_season_csk, SUM(tov IS NULL) as tov_per_season_incomplete, ROUND((SUM(tov))/(SUM(games*(tov IS NOT NULL))),1) AS tov_per_season, (SUM(pf))/(SUM(games*(pf IS NOT NULL))) as pf_per_season_csk, SUM(pf IS NULL) as pf_per_season_incomplete, ROUND((SUM(pf))/(SUM(games*(pf IS NOT NULL))),1) AS pf_per_season, (SUM(pts))/(SUM(games)) as pts_per_season_csk, SUM(pts IS NULL) as pts_per_season_incomplete, ROUND((SUM(pts))/(SUM(games)),1) AS pts_per_season, SUM(games IS NULL) as games_incomplete, SUM(games) AS games
FROM sup_team_seasons as st
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE ((team_id=?) OR (team_id=?))
AND type="reg"
GROUP BY team_id LIMIT 0, 200
SQL PARAMS -- $VAR1 = [
'TOR',
'MIN'
];
Query Time: 0.01 seconds
SELECT (SELECT name_abbr FROM sup_team_seasons WHERE team_id=st.team_id AND sup_team_seasons.year_id=MAX(st.year_id) LIMIT 1) as franch_abbr, team_id, MIN(year_id) as year_min_csk, IF(comp_id='WNBA', MIN(year_id), CONCAT_WS('-', (MIN(year_id) - 1), RIGHT(MIN(year_id), 2))) as year_min, MAX(year_id) as year_max_csk, IF(comp_id='WNBA', MAX(year_id), CONCAT_WS('-', (MAX(year_id) - 1), RIGHT(MAX(year_id), 2))) as year_max, (SUM(fg))/(SUM(games)) as fg_per_season_csk, SUM(fg IS NULL) as fg_per_season_incomplete, ROUND((SUM(fg))/(SUM(games)),1) AS fg_per_season, (SUM(fga))/(SUM(games)) as fga_per_season_csk, SUM(fga IS NULL) as fga_per_season_incomplete, ROUND((SUM(fga))/(SUM(games)),1) AS fga_per_season, IF(SUM(fga), SUM(fg) / SUM(fga), NULL) as fg_pct_csk, SUM(fga IS NULL)+SUM(fg IS NULL) as fg_pct_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga), SUM(fg) / SUM(fga), NULL),3)) AS fg_pct, (SUM(fg)/(SUM(games)) - IFNULL(SUM(fg3 * (fg IS NOT NULL))/SUM(games*(fg IS NOT NULL)), 0)) as fg2_per_season_csk, NULL as fg2_per_season_incomplete, ROUND((SUM(fg)/(SUM(games)) - IFNULL(SUM(fg3 * (fg IS NOT NULL))/SUM(games*(fg IS NOT NULL)), 0)),1) AS fg2_per_season, (SUM(fga)/(SUM(games)) - IFNULL(SUM(fg3a * (fga IS NOT NULL))/SUM(games*(fga IS NOT NULL)), 0)) as fg2a_per_season_csk, NULL as fg2a_per_season_incomplete, ROUND((SUM(fga)/(SUM(games)) - IFNULL(SUM(fg3a * (fga IS NOT NULL))/SUM(games*(fga IS NOT NULL)), 0)),1) AS fg2a_per_season, SUM(fg - IFNULL(fg3, 0)) / SUM(fga - IFNULL(fg3a, 0)) as fg2_pct_csk, NULL as fg2_pct_incomplete, TRIM(LEADING '0' FROM ROUND(SUM(fg - IFNULL(fg3, 0)) / SUM(fga - IFNULL(fg3a, 0)),3)) AS fg2_pct, (SUM(fg3))/(SUM(games*(fg3 IS NOT NULL))) as fg3_per_season_csk, NULL as fg3_per_season_incomplete, ROUND((SUM(fg3))/(SUM(games*(fg3 IS NOT NULL))),1) AS fg3_per_season, (SUM(fg3a))/(SUM(games*(fg3a IS NOT NULL))) as fg3a_per_season_csk, NULL as fg3a_per_season_incomplete, ROUND((SUM(fg3a))/(SUM(games*(fg3a IS NOT NULL))),1) AS fg3a_per_season, IF(SUM(fg3a), SUM(fg3) / SUM(fg3a), NULL) as fg3_pct_csk, NULL as fg3_pct_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(fg3a), SUM(fg3) / SUM(fg3a), NULL),3)) AS fg3_pct, IF(SUM(fga), SUM(fg + 0.5 * IFNULL(fg3, 0)) / SUM(fga), NULL) as efg_pct_csk, NULL as efg_pct_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga), SUM(fg + 0.5 * IFNULL(fg3, 0)) / SUM(fga), NULL),3)) AS efg_pct, (SUM(ft))/(SUM(games)) as ft_per_season_csk, SUM(ft IS NULL) as ft_per_season_incomplete, ROUND((SUM(ft))/(SUM(games)),1) AS ft_per_season, (SUM(fta))/(SUM(games*(fta IS NOT NULL))) as fta_per_season_csk, SUM(fta IS NULL) as fta_per_season_incomplete, ROUND((SUM(fta))/(SUM(games*(fta IS NOT NULL))),1) AS fta_per_season, IF(SUM(fta), SUM(ft) / SUM(fta), NULL) as ft_pct_csk, SUM(fta IS NULL)+SUM(ft IS NULL) as ft_pct_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(fta), SUM(ft) / SUM(fta), NULL),3)) AS ft_pct, (SUM(orb))/(SUM(games*(orb IS NOT NULL))) as orb_per_season_csk, SUM(orb IS NULL) as orb_per_season_incomplete, ROUND((SUM(orb))/(SUM(games*(orb IS NOT NULL))),1) AS orb_per_season, (SUM(trb * (orb IS NOT NULL))/SUM(games*(orb IS NOT NULL)) - SUM(orb * (orb IS NOT NULL))/SUM(games*(orb IS NOT NULL))) as drb_per_season_csk, SUM(orb IS NULL)+SUM(trb IS NULL) as drb_per_season_incomplete, ROUND((SUM(trb * (orb IS NOT NULL))/SUM(games*(orb IS NOT NULL)) - SUM(orb * (orb IS NOT NULL))/SUM(games*(orb IS NOT NULL))),1) AS drb_per_season, (SUM(trb))/(SUM(games*(trb IS NOT NULL))) as trb_per_season_csk, SUM(trb IS NULL) as trb_per_season_incomplete, ROUND((SUM(trb))/(SUM(games*(trb IS NOT NULL))),1) AS trb_per_season, (SUM(ast))/(SUM(games*(ast IS NOT NULL))) as ast_per_season_csk, SUM(ast IS NULL) as ast_per_season_incomplete, ROUND((SUM(ast))/(SUM(games*(ast IS NOT NULL))),1) AS ast_per_season, (SUM(stl))/(SUM(games*(stl IS NOT NULL))) as stl_per_season_csk, SUM(stl IS NULL) as stl_per_season_incomplete, ROUND((SUM(stl))/(SUM(games*(stl IS NOT NULL))),1) AS stl_per_season, (SUM(blk))/(SUM(games*(blk IS NOT NULL))) as blk_per_season_csk, SUM(blk IS NULL) as blk_per_season_incomplete, ROUND((SUM(blk))/(SUM(games*(blk IS NOT NULL))),1) AS blk_per_season, (SUM(tov))/(SUM(games*(tov IS NOT NULL))) as tov_per_season_csk, SUM(tov IS NULL) as tov_per_season_incomplete, ROUND((SUM(tov))/(SUM(games*(tov IS NOT NULL))),1) AS tov_per_season, (SUM(pf))/(SUM(games*(pf IS NOT NULL))) as pf_per_season_csk, SUM(pf IS NULL) as pf_per_season_incomplete, ROUND((SUM(pf))/(SUM(games*(pf IS NOT NULL))),1) AS pf_per_season, (SUM(pts))/(SUM(games)) as pts_per_season_csk, SUM(pts IS NULL) as pts_per_season_incomplete, ROUND((SUM(pts))/(SUM(games)),1) AS pts_per_season, SUM(games IS NULL) as games_incomplete, SUM(games) AS games
FROM sup_team_seasons as st
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE ((team_id=?) OR (team_id=?))
AND phase_id="PST"
GROUP BY team_id LIMIT 0, 200
SQL PARAMS -- $VAR1 = [
'TOR',
'MIN'
];
Query Time: 0.00 seconds
Table Build Time: 0.04 seconds
Table Build Time: 0.04 seconds
--------------------------------------
overall_sum
Page Setup Time: 0.00158 seconds
SELECT (SELECT name_abbr FROM sup_team_seasons WHERE team_id=st.team_id AND sup_team_seasons.year_id=MAX(st.year_id) LIMIT 1) as franch_abbr, team_id, MIN(year_id) as year_min_csk, IF(comp_id='WNBA', MIN(year_id), CONCAT_WS('-', (MIN(year_id) - 1), RIGHT(MIN(year_id), 2))) as year_min, MAX(year_id) as year_max_csk, IF(comp_id='WNBA', MAX(year_id), CONCAT_WS('-', (MAX(year_id) - 1), RIGHT(MAX(year_id), 2))) as year_max, SUM(wins IS NULL) as wins_incomplete, SUM(wins) AS wins, SUM(losses IS NULL) as losses_incomplete, SUM(losses) AS losses, SUM(games IS NULL) as games_incomplete, SUM(games) AS games, SUM(fg IS NULL) as fg_incomplete, SUM(fg) AS fg, SUM(fga IS NULL) as fga_incomplete, SUM(fga) AS fga, IF(SUM(fga), SUM(fg) / SUM(fga), NULL) as fg_pct_csk, SUM(fga IS NULL)+SUM(fg IS NULL) as fg_pct_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga), SUM(fg) / SUM(fga), NULL),3)) AS fg_pct, NULL as fg2_incomplete, SUM(fg - IFNULL(fg3, 0)) AS fg2, NULL as fg2a_incomplete, SUM(fga - IFNULL(fg3a, 0)) AS fg2a, SUM(fg - IFNULL(fg3, 0)) / SUM(fga - IFNULL(fg3a, 0)) as fg2_pct_csk, NULL as fg2_pct_incomplete, TRIM(LEADING '0' FROM ROUND(SUM(fg - IFNULL(fg3, 0)) / SUM(fga - IFNULL(fg3a, 0)),3)) AS fg2_pct, NULL as fg3_incomplete, SUM(fg3) AS fg3, NULL as fg3a_incomplete, SUM(fg3a) AS fg3a, IF(SUM(fg3a), SUM(fg3) / SUM(fg3a), NULL) as fg3_pct_csk, NULL as fg3_pct_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(fg3a), SUM(fg3) / SUM(fg3a), NULL),3)) AS fg3_pct, IF(SUM(fga), SUM(fg + 0.5 * IFNULL(fg3, 0)) / SUM(fga), NULL) as efg_pct_csk, NULL as efg_pct_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga), SUM(fg + 0.5 * IFNULL(fg3, 0)) / SUM(fga), NULL),3)) AS efg_pct, SUM(ft IS NULL) as ft_incomplete, SUM(ft) AS ft, SUM(fta IS NULL) as fta_incomplete, SUM(fta) AS fta, IF(SUM(fta), SUM(ft) / SUM(fta), NULL) as ft_pct_csk, SUM(fta IS NULL)+SUM(ft IS NULL) as ft_pct_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(fta), SUM(ft) / SUM(fta), NULL),3)) AS ft_pct, SUM(orb IS NULL) as orb_incomplete, SUM(orb) AS orb, SUM(trb IS NULL)+SUM(orb IS NULL) as drb_incomplete, SUM(trb - orb) AS drb, SUM(trb IS NULL) as trb_incomplete, SUM(trb) AS trb, SUM(ast IS NULL) as ast_incomplete, SUM(ast) AS ast, SUM(stl IS NULL) as stl_incomplete, SUM(stl) AS stl, SUM(blk IS NULL) as blk_incomplete, SUM(blk) AS blk, SUM(tov IS NULL) as tov_incomplete, SUM(tov) AS tov, SUM(pf IS NULL) as pf_incomplete, SUM(pf) AS pf, SUM(pts IS NULL) as pts_incomplete, SUM(pts) AS pts
FROM sup_team_seasons as st
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE ((team_id=?) OR (team_id=?))
AND type="reg"
GROUP BY team_id LIMIT 0, 200
SQL PARAMS -- $VAR1 = [
'TOR',
'MIN'
];
Query Time: 0.00 seconds
SELECT (SELECT name_abbr FROM sup_team_seasons WHERE team_id=st.team_id AND sup_team_seasons.year_id=MAX(st.year_id) LIMIT 1) as franch_abbr, team_id, MIN(year_id) as year_min_csk, IF(comp_id='WNBA', MIN(year_id), CONCAT_WS('-', (MIN(year_id) - 1), RIGHT(MIN(year_id), 2))) as year_min, MAX(year_id) as year_max_csk, IF(comp_id='WNBA', MAX(year_id), CONCAT_WS('-', (MAX(year_id) - 1), RIGHT(MAX(year_id), 2))) as year_max, SUM(wins IS NULL) as wins_incomplete, SUM(wins) AS wins, SUM(losses IS NULL) as losses_incomplete, SUM(losses) AS losses, SUM(games IS NULL) as games_incomplete, SUM(games) AS games, SUM(fg IS NULL) as fg_incomplete, SUM(fg) AS fg, SUM(fga IS NULL) as fga_incomplete, SUM(fga) AS fga, IF(SUM(fga), SUM(fg) / SUM(fga), NULL) as fg_pct_csk, SUM(fga IS NULL)+SUM(fg IS NULL) as fg_pct_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga), SUM(fg) / SUM(fga), NULL),3)) AS fg_pct, NULL as fg2_incomplete, SUM(fg - IFNULL(fg3, 0)) AS fg2, NULL as fg2a_incomplete, SUM(fga - IFNULL(fg3a, 0)) AS fg2a, SUM(fg - IFNULL(fg3, 0)) / SUM(fga - IFNULL(fg3a, 0)) as fg2_pct_csk, NULL as fg2_pct_incomplete, TRIM(LEADING '0' FROM ROUND(SUM(fg - IFNULL(fg3, 0)) / SUM(fga - IFNULL(fg3a, 0)),3)) AS fg2_pct, NULL as fg3_incomplete, SUM(fg3) AS fg3, NULL as fg3a_incomplete, SUM(fg3a) AS fg3a, IF(SUM(fg3a), SUM(fg3) / SUM(fg3a), NULL) as fg3_pct_csk, NULL as fg3_pct_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(fg3a), SUM(fg3) / SUM(fg3a), NULL),3)) AS fg3_pct, IF(SUM(fga), SUM(fg + 0.5 * IFNULL(fg3, 0)) / SUM(fga), NULL) as efg_pct_csk, NULL as efg_pct_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(fga), SUM(fg + 0.5 * IFNULL(fg3, 0)) / SUM(fga), NULL),3)) AS efg_pct, SUM(ft IS NULL) as ft_incomplete, SUM(ft) AS ft, SUM(fta IS NULL) as fta_incomplete, SUM(fta) AS fta, IF(SUM(fta), SUM(ft) / SUM(fta), NULL) as ft_pct_csk, SUM(fta IS NULL)+SUM(ft IS NULL) as ft_pct_incomplete, TRIM(LEADING '0' FROM ROUND(IF(SUM(fta), SUM(ft) / SUM(fta), NULL),3)) AS ft_pct, SUM(orb IS NULL) as orb_incomplete, SUM(orb) AS orb, SUM(trb IS NULL)+SUM(orb IS NULL) as drb_incomplete, SUM(trb - orb) AS drb, SUM(trb IS NULL) as trb_incomplete, SUM(trb) AS trb, SUM(ast IS NULL) as ast_incomplete, SUM(ast) AS ast, SUM(stl IS NULL) as stl_incomplete, SUM(stl) AS stl, SUM(blk IS NULL) as blk_incomplete, SUM(blk) AS blk, SUM(tov IS NULL) as tov_incomplete, SUM(tov) AS tov, SUM(pf IS NULL) as pf_incomplete, SUM(pf) AS pf, SUM(pts IS NULL) as pts_incomplete, SUM(pts) AS pts
FROM sup_team_seasons as st
JOIN sup_phase_seasons USING (year_id, comp_id, phase_id)
WHERE ((team_id=?) OR (team_id=?))
AND phase_id="PST"
GROUP BY team_id LIMIT 0, 200
SQL PARAMS -- $VAR1 = [
'TOR',
'MIN'
];
Query Time: 0.00 seconds
Table Build Time: 0.04 seconds
Table Build Time: 0.04 seconds
--------------------------------------
SH->PARAM -- $VAR1 = {
'team_id1' => 'MIN',
'team_id2' => 'TOR',
't2yrto' => 2026,
't1yrto' => 2026,
'match' => 'versus_teamvteam'
};
SH->PARAM_NO_DEFAULT -- $VAR1 = {
'team_id1' => 'MIN',
'match' => 'versus_teamvteam',
'team_id2' => 'TOR'
};
Data coverage:
Game data: since 1946-47 unless otherwise noted. Regular season: PTS, FG, FT, 3P complete all-time. FTA complete back to 1948-49. FGA, TRB, AST, PF, GS over 99% complete back to 1975-76. MP over 99% complete back to 1976-77. +/- complete back to 1996-97. All other box score stats (3PA, ORB, DRB, STL, BLK, TOV) complete back to 1983-84. Playoffs: PTS, FG, FT, FTA, 3P, 3PA complete all-time. PF complete back to 1948-49. FGA, TRB, AST complete back to 1962-63. GS complete back to 1973-74. MP complete back to 1974-75. +/- complete back to 1996-97. STL, BLK, TOV complete back to 1982-83. ORB, DRB complete back to 1983-84. BPM not available for WNBA & ABA.
Season data: since 1946-47 unless otherwise noted. All box score stats are covered all-time (though not all stats were tracked for all of NBA history). PER since 1951-52. AST% since 1964-65. TRB% since 1970-71. BPM, VORP, DRtg and Per 100 Poss stats since 1973-74. ORtg since 1977-78. GS since 1981-82. Some stats were available earlier in the ABA. WNBA all-time (since 1997) unless otherwise noted. BPM and VORP not available for WNBA.
Please see our data coverage page for details.

We're Social...for Statheads
Site Last Updated:
Question, Comment, Feedback, or Correction?
Subscribe to our Free Email Newsletter
Do you have a sports website? Or write about sports? We have tools and resources that can help you use sports data. Find out more.