Created
February 2, 2015 11:31
-
-
Save Noxville/40b53443a0c3603fa12b to your computer and use it in GitHub Desktop.
SQL Winner Group By Faction, limited by teams Rating.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT m.winner as winner, count(*) as cnt | |
from mtch m | |
JOIN elo_team_data_point radiant_elo | |
ON (m.radiant_team = radiant_elo.team and DATE(m.date) = radiant_elo.elo_date) | |
JOIN elo_team_data_point dire_elo | |
ON (m.dire_team = dire_elo.team and DATE(m.date) = dire_elo.elo_date) | |
WHERE | |
(radiant_elo.rating > 1200) and | |
(dire_elo.rating > 1200) and | |
(m.match_id >= 1098011255) and | |
abs(radiant_elo.rating - dire_elo.rating) <= 100 | |
GROUP by winner; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment