nick2price
Registered User.
- Local time
- Yesterday, 22:57
- Joined
- Sep 24, 2008
- Messages
- 14
Hi
I have my tables in the following relationships
Now i am trying to perform a query which will return the 3 fastest times, with the associated Nationality, First_Name and Last_Name (of the athletes that got the time) for a given event and round.
I have done the query as follows
This however seems to return the fasest time for round 1, and that time is returned with every single athelete in my database (even from different rounds). I think i havnt stated in the query that i only want the associated athletes with the three fastest times. Any help would be greatly appreciated.
cheers
I have my tables in the following relationships
Now i am trying to perform a query which will return the 3 fastest times, with the associated Nationality, First_Name and Last_Name (of the athletes that got the time) for a given event and round.
I have done the query as follows
Code:
SELECT TOP 3 r.result, c.Nationality, c.First_Name, c.Last_Name
FROM tblResults AS r, tblCompetitor AS c
WHERE r.Event_ID =
(select e.ID
from tblEvent as e
where e.Event_Name = '100M Run')
and r.Round_ID =
(select ro.ID
from tblRound as ro
where ro.Round_Number = 'Round_1')
ORDER BY r.result;
This however seems to return the fasest time for round 1, and that time is returned with every single athelete in my database (even from different rounds). I think i havnt stated in the query that i only want the associated athletes with the three fastest times. Any help would be greatly appreciated.
cheers