The SQL database has over 4,500 games, stretching all the way back to the 2000 season.
Sorry, no data table was returned from this Crunch.
SET @temp = '', @versus = '', @versus2 = '', @game = 0;
WITH inside AS
(SELECT _when, _rnd, _ha, _tm, _op, _vn, _score, _cwd, _tmRung, _opRung, _tmFin, _opFin, _for AS '_for', _agt AS '_agt', (_for) - (_agt) AS '_mgn', IF((_for) - (_agt) > 0, 'W', IF((_for) - (_agt) = 0, 'D', 'L')) AS '_WL', ROW_NUMBER() OVER (PARTITION BY _tm ORDER BY _when DESC) as '_game', DATEDIFF(_when, LAG(_when, 1) OVER (PARTITION BY _tm ORDER BY _when)) AS '_tmDays', DATEDIFF(_when, LAG(_when, 1) OVER (PARTITION BY _op ORDER BY _when)) AS '_opDays', LAG(_vn, 1) OVER (PARTITION BY _tm ORDER BY _when) AS '_pre' FROM haven WHERE YEAR(_when) BETWEEN 2010 AND 2023),
middle AS (SELECT *,
@temp := if (_tm > _op, CONCAT(LEFT(_op, 2), LEFT(_tm, 2)), CONCAT(LEFT(_tm, 2), LEFT(_op, 2))) AS _temp,
@versus2 := IF (_HA = 'H' AND LOCATE(@temp, @versus) > 0, CONCAT(@versus2, @temp, '.'), @versus2) AS _V2,
@versus := IF (_HA = 'H' AND LOCATE(@temp, @versus) = 0, CONCAT(@versus, @temp, '.'), @versus) AS _V1,
@game := @game + 1,
ROW_NUMBER() OVER (ORDER BY _when DESC) as '_rank' FROM inside WHERE YEAR(_when) = 2023 AND _rnd < 30)
SELECT @versus, @game, CHAR_LENGTH(@versus2), CHAR_LENGTH(@versus), _tm AS 'Team', count(*) AS 'P', SUM(IF(_for > _agt, 1, 0)) AS 'W', SUM(IF(_for = _agt, 1, 0)) AS 'L', SUM(IF(_for = _agt, 1, 0)) AS 'D', SUM(_for) as 'For_.0', SUM(_agt) as 'Agt', SUM(IF(_for > _agt, 4 / IF(LOCATE(_temp, @versus2) > 0, 2, 1), IF(_for = _agt, 2 / IF(LOCATE(_temp, @versus2) > 0, 2, 1), 0))) AS 'Pts', 100 * SUM(_for) / SUM(_agt) AS '%_.1%' FROM middle WHERE 1 GROUP BY _tm ORDER BY SUM(IF(_for > _agt, 40, IF(_for = _agt, 20, 0))) + (SUM(_for) / SUM(_agt)) DESC
Very much a work in progress.
Imagine a perfect season - where each team plays each other twice, home and away.
This crunch goes back to find the last time each team played each other. Even back to 2017 for the last time the Eagles played the Lions at home.
You can find the ladder in the new 'Crunch' section (menu to the left).
So how does everyone else hold up?
# | Team | P | W | L | D | For | Agt | Pts | % |
---|---|---|---|---|---|---|---|---|---|
1 | Haw | 5 | 4 | 1 | 0 | 485 | 408 | 16 | 119 |
2 | Bul | 5 | 3 | 2 | 0 | 389 | 379 | 12 | 103 |
3 | Cat | 5 | 2 | 3 | 0 | 455 | 419 | 8 | 109 |
4 | Swa | 5 | 2 | 3 | 0 | 390 | 431 | 8 | 90 |
5 | Dem | 5 | 2 | 3 | 0 | 385 | 411 | 8 | 94 |
6 | Tig | 5 | 2 | 3 | 0 | 423 | 486 | 8 | 87 |
7 | Bom | 5 | 1 | 4 | 0 | 329 | 448 | 4 | 73 |
8 | Pow | 5 | 1 | 4 | 0 | 430 | 503 | 4 | 85 |
9 | Cro | 5 | 1 | 4 | 0 | 412 | 409 | 4 | 101 |
10 | Sun | 5 | 1 | 4 | 0 | 357 | 459 | 4 | 78 |
11 | Blu | 5 | 1 | 4 | 0 | 361 | 415 | 4 | 87 |
12 | Doc | 5 | 1 | 4 | 0 | 366 | 469 | 4 | 78 |
13 | Eag | 5 | 1 | 4 | 0 | 296 | 540 | 4 | 55 |
14 | Gia | 5 | 0 | 5 | 0 | 335 | 473 | 0 | 71 |
15 | Sai | 5 | 0 | 5 | 0 | 303 | 385 | 0 | 79 |
16 | Kan | 5 | 0 | 5 | 0 | 321 | 569 | 0 | 56 |
5.0 | 1.4 | 3.6 | 0.0 | 377.3 | 450.3 | 5.5 | 85.3 |
Well, it seems the Hawks are doing quite well!
The tables are fully scripted! You can sort the columns by clicking on the column header (click a second time to reverse the sort). Hovering over the column name should give you a descriptor and/or and average value for that column. And clicking the team name should open up a second table with more detailed breakdown of the last 25 games involved.
# | Tm | P | W | D | L | F | A | Pts | % | Days |
---|---|---|---|---|---|---|---|---|---|---|
1 | Mag | 23 | 18 | 0 | 5 | 2,142 | 1,687 | 72 | 127 | 253 |
2 | Lio | 23 | 17 | 0 | 6 | 2,180 | 1,771 | 68 | 123 | 252 |
3 | Pow | 23 | 17 | 0 | 6 | 2,149 | 1,906 | 68 | 113 | 251 |
4 | Dem | 23 | 16 | 0 | 7 | 2,079 | 1,660 | 64 | 125 | 251 |
5 | Blu | 23 | 13 | 1 | 9 | 1,922 | 1,697 | 54 | 113 | 251 |
6 | Sai | 23 | 13 | 0 | 10 | 1,775 | 1,647 | 52 | 108 | 252 |
7 | Gia | 23 | 13 | 0 | 10 | 2,018 | 1,885 | 52 | 107 | 251 |
8 | Swa | 23 | 12 | 1 | 10 | 2,050 | 1,863 | 50 | 110 | 251 |
9 | Bul | 23 | 12 | 0 | 11 | 1,919 | 1,766 | 48 | 109 | 252 |
10 | Cro | 23 | 11 | 0 | 12 | 2,193 | 1,877 | 44 | 117 | 252 |
11 | Bom | 23 | 11 | 0 | 12 | 1,838 | 2,050 | 44 | 90 | 253 |
12 | Cat | 23 | 10 | 1 | 12 | 2,088 | 1,855 | 42 | 113 | 252 |
13 | Tig | 23 | 10 | 1 | 12 | 1,856 | 1,983 | 42 | 94 | 251 |
14 | Doc | 23 | 10 | 0 | 13 | 1,835 | 1,898 | 40 | 97 | 252 |
15 | Sun | 23 | 9 | 0 | 14 | 1,839 | 2,006 | 36 | 92 | 252 |
16 | Haw | 23 | 7 | 0 | 16 | 1,686 | 2,101 | 28 | 80 | 252 |
17 | Kan | 23 | 3 | 0 | 20 | 1,657 | 2,318 | 12 | 72 | 252 |
18 | Eag | 23 | 3 | 0 | 20 | 1,418 | 2,674 | 12 | 53 | 252 |
23.0 | 11.4 | 0.2 | 11.4 | 46.0 | 102.3 | 251.8 |