Hey guys I was wondering if you could help me with what is probably a simple SQL query. What I was wanting to do was to get a listing of all pitchers ERA in year 1 as well as the same pitchers ERA in year 2. What I was wanting to do is have some cutoff (say greater than 150 innings pitched each season) so that I'm only getting pitchers that have pitched 150+ in each season. How would I go about this?
First, go ahead and set up the season stats views like so:
Then, do something like:
SELECT p1.playerID, p1.yearID, p1.ERA, p2.ERA
FROM pitch_year_total_avg p1, pitch_year_total_avg p2
WHERE p1.playerID = p2.playerID
AND p1.yearID = p2.yearID + 1;