Created
February 19, 2015 16:37
-
-
Save Noxville/c2163a874e8dbc87f1a9 to your computer and use it in GitHub Desktop.
El Classics
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 | |
CASE | |
WHEN radiant_team < dire_team | |
THEN radiant_team | |
ELSE dire_team | |
END as lhs, | |
CASE | |
WHEN radiant_team > dire_team | |
THEN radiant_team | |
ELSE dire_team | |
END as rhs, | |
count(*) as c | |
FROM mtch | |
WHERE | |
radiant_team != "Unknown" and | |
dire_team != "Unknown" and | |
date > '2014-07-22' | |
GROUP BY CASE | |
WHEN radiant_team < dire_team | |
THEN radiant_team | |
ELSE dire_team | |
END, CASE | |
WHEN radiant_team > dire_team | |
THEN radiant_team | |
ELSE dire_team | |
END | |
ORDER BY c desc | |
LIMIT 30; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment