Last active
August 29, 2015 14:07
-
-
Save sinsoku/59de3a56c898bea1a245 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| to_char(g.sellday, 'YYYY') "year", | |
| g.sellday, | |
| g.gamename, | |
| g.median | |
| FROM gamelist g | |
| INNER JOIN ( | |
| SELECT | |
| to_char(g2.sellday, 'YYYY') "year", | |
| MAX(g2.median) "median" | |
| FROM gamelist g2 | |
| WHERE | |
| g2.sellday BETWEEN to_date('2004', 'YYYY') AND to_date('2015', 'YYYY') | |
| AND | |
| g2.gamename LIKE '%妹%' | |
| GROUP BY | |
| to_char(g2.sellday, 'YYYY') | |
| ) t | |
| ON | |
| to_char(g.sellday, 'YYYY') = t.year | |
| WHERE | |
| g.median = t.median | |
| AND | |
| g.gamename LIKE '%妹%' | |
| ORDER BY | |
| g.sellday; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment