I'm a total newbie at sabermetrics, so I am just playing around with a mysql database with the Baseball databank installed. I was reading something about payrolls and wanted to see payrolls for the last 10 years or so. Couldn't find it on google, so I fired up MAMP/Sequel Pro and tried to write a query. I wanted to see payroll for all MLB teams for 2008 (later I'd want to combine 2000-2009 or so). Here's my code:
SELECT teamID, yearID, sum(salary) AS PAYROLL FROM salaries GROUP BY teamID HAVING yearID=2008 ORDER BY PAYROLL Desc LIMIT 50
Didn't work…no error, but no output. What am I doing wrong? And how would I get 2000-2009 figures?