Created
June 23, 2016 18:13
-
-
Save friscojosh/86f798e7fdaa38c76ec6f521d7f5ad75 to your computer and use it in GitHub Desktop.
SQL to do complex year over year queries
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 a.player, a.fname, a.lname, a.year, a.top12 | |
, b.year, b.top12 | |
FROM | |
(SELECT __top12_weeks_WR.* | |
FROM __top12_weeks_WR)a | |
INNER JOIN | |
(SELECT __top12_weeks_WR.* | |
FROM __top12_weeks_WR)b | |
ON a.player = b.player | |
AND a.year = b.year - 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment