Sorter Teams
Jeg ønsker at opdatere et felt 'Range' i tabellen LeageDetails.select Div,Team, sum(homepoints + awaypoints) as points,
sum(Homediff + AwayDiff) as goals from LeageDetails
group by div,idLeages,Team
order by Div, Points desc
eks. på udtræk tilført feltet Range, som ønskes beregnet.
Div Team Point Goals Range
B1 Mechelen 20 -21 2
B1 Lierse 20 -13 1
B1 Oud-Heverlee Leuven 19 -10 3
B1 Waasland-Beveren 17 -12 4
B1 Bergen 13 -15 5
D1 Bayern Munich 44 34 1
D1 Leverkusen 37 17 2
D1 Mgladbach 33 16 3
D1 Dortmund 32 18 4
Range skal beregnes som højeste points/goals pr. Div.
Range skal opdates i tabellen LeageDetails.