Hi all,
I have set up a simple VB program (and later on an ASP interface) to
manage an Athletics database. I'm using Access 2000.
To simplify, I have the Athlets, the Competitions and the Scores
tables.
When I want to list of the best scores/ranking, I just do:
SELECT TOP <how-many-best> AthletsName, Competitiondate,
CompetitionPlace, Score
FROM Scores INNER JOIN Competitions ... INNER JOIN Athlets ...
ORDER BY Score [DESC]
([DESC] is present if the scores are measured in times and not if they
are lengths)
I come into a problem whehter I want to list the best athlets, so to
say listing just the best results for each Athlet.
If I add a group by Athletsname parameter in the SQL, I am not any
longer able to display Competitiondate, CompetitionPlace because they
are not part of the aggregate function. :-(
So to say, I can only do:
---
SELECT TOP <how-many-best> AthletsName, Min(Score)
FROM Scores INNER JOIN Competitions ... INNER JOIN Athlets ...
GROUP BY AthletsName
ORDER BY Min(Score)
for scores in time
SELECT TOP <how-many-best> AthletsName, Max(Score)
FROM Scores INNER JOIN Competitions ... INNER JOIN Athlets ...
GROUP BY AthletsName
ORDER BY Max(Score)
for scores in lenght
---
How can I do, which SQL command can I use to be able to view all the
fields of the first SQL with just the best Athlets and not all the
best scores?
Many thanks for your replies.
Best regards,
Irene