![]() |
Help on streamlining a query in MySQL
I'm trying to look at some era comparisons in FOF. I'm wanting to start with something basic: player ypa for a season versus league-wide ypa for the season. The idea here is that if a guy gets ypa above the league-wide average, he gets a score over 100. It it's below the league-wide average, his score is under 100. Here's the query I created (not certain if this *should* work, even...)
Code:
SELECT sum(s.passyards)/sum(s.passattempts) AS ypa, s.year, lastname, firstname,It has been running for 10 minutes already, on a relatively fast server. That seems excessive, and I suspect that it's because of something I did wrong there in the nesting. Li'l help? |
You need a better join between s and s1 than just Year. Those are pass attempts by player, right? Since you're summing everything, I'd think you'd want year and playerid.
|
| All times are GMT -5. The time now is 11:37 AM. |
Powered by vBulletin Version 3.6.0
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.