Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 use of distinct

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-11-17 : 09:07:56
Martin Phoenix writes "Hi there,

I have a website i am working on about athletics. It contains all the results of races from
the different meets run during the season. they are stored in a table
and can be retrieved easily.

i want to be able to give visitors to the site the option of viewing the rankings of the fastest in each event but i am having a problem when it selects all the times for a given event when some athletes have more than one time in the top 10.

i would like it to give me the ten fastest in order from fastest to slowest without repeating athletes names.

i believe DISTINCT can help me by selecting distinct athletesid but i also want to select the rest of the details on that row of the table.

any ideas ?

thanks

ps - sql = "Select * From Performance where eventid = " & thisevent & " AND athtype = " & thisath & " ORDER BY result ASC"

thisath being either male, female, disabled
thisevent being an id from another table containing alist of all the events."
   

- Advertisement -