我有守门员的数据表,snipet下面10期在移动平均的MySQL不使用日期
year gameid player sv% gamenum
2009 200165 John Smith 0.923 0165
2009 209754 John Smith 1.000 9754
2009 206938 John Smith 1.000 6938
2009 206155 John Smith 0.833 6155
2009 203021 John Smith 0.667 3021
2009 206472 John Smith 0.909 6472
2009 209524 John Smith 0.833 9524
2009 209351 John Smith 0.800 9351
2009 203056 John Smith 1.000 3056
2009 206761 John Smith 0.935 6761
2009 200466 John Smith 0.954 0466
2009 204171 John Smith 0.932 4171
2009 207876 John Smith 0.958 7876
2009 201581 John Smith 0.941 1581
2009 205286 John Smith 0.930 5286
2009 208991 John Smith 0.961 8991
2009 202696 John Smith 0.916 2696
2009 206401 John Smith 0.935 6401
2009 200106 John Smith 0.921 0106
2009 201381 John Smith 0.918 1381
我想要得到的10场比赛移动平均每个守门员,但我没有日期比如他的第一场,第二场,第三场比赛等。比赛ID也按照他们在联赛级别上的顺序进行分配,所以比赛200106可能是他的第一场比赛,而200165可能是他的第二场比赛,等等。
我的问题是:我怎样才能得到每个守门员每年分组的最大(10场移动平均)和最小(10场移动平均)?
另外,有没有一种方法可以通过守门员,一年使用MySql对游戏id进行排名?
谢谢。我收到错误消息:“每个派生表都必须有自己的别名” – NeilG 2011-03-27 20:06:58
请参阅编辑,每个子查询必须命名,最外面的一个不是 – dfb 2011-03-27 21:48:09