herbertioz
Registered User.
- Local time
- Today, 22:21
- Joined
- Nov 6, 2009
- Messages
- 66
I want to ask the database after the teams (lag) with the athletes listed in the team with the highest TotalVekt (TotalWeight).
With the code under I find the teams with the highest TotalWeight, but not with the athletes on the team and their weight combined with the totalweight of the team. Can someone help?
Lag = Teams
Deltagere = Athletes
Vekt = Weight
With the code under I find the teams with the highest TotalWeight, but not with the athletes on the team and their weight combined with the totalweight of the team. Can someone help?

Lag = Teams
Deltagere = Athletes
Vekt = Weight
Code:
SELECT Lag.Lagnavn, Sum(Deltagere.Vekt) AS TotalVektLag
FROM Lag INNER JOIN Deltagere ON Lag.ID=Deltagere.LagID
GROUP BY Lag.Lagnavn;