Last active
August 29, 2015 14:19
-
-
Save dnasca/fafb44aab316e5507ee5 to your computer and use it in GitHub Desktop.
This query will return all players from 1871 - 2014 who had at least 7000 AB's during their career. The list is sorted by the lowest->strikeout percentages (SOPERC)
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
| #using the Lahman Baseball Database | |
| SELECT | |
| CONCAT(YEAR(m.debut), ' - ', YEAR(m.finalGame)) AS YEARSPLAYED, | |
| CONCAT(m.nameFirst, ' ', m.nameLast) AS NAME, | |
| SUM(b.AB) AS AB, | |
| ROUND(SUM(b.so) / SUM(b.AB + b.BB + b.HBP + COALESCE(b.SF, 0)) * 100, 2) AS SOPERC | |
| FROM | |
| Batting b, | |
| Master m | |
| WHERE | |
| b.playerID = m.playerID | |
| GROUP BY b.playerID HAVING AB > 7000 | |
| AND YEARSPLAYED <> 'null' | |
| ORDER BY SOPERC ASC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment