Complicated SQL Sort and NO DUPLICATES help

G

Guest

Quick version of question:

I have a table with that I want to sort on one columb, and have no
duplicates in the other. I only want the no duplicates in one columb and I
want to sort after the duplicates have been removed. How do I do this?

Longer explination of question:
I'm a swim coach and I have a huge database of times. I'm trying to get the
database to display the best time of each swimmer in order from fastest to
slowest. Here are the columbs that this questions applies to:

1: Swimmer_ID String
2: Time Integer

I want to have no duplicates in Swimmer_ID and I want the fastest time
(lowest number) in the database for Time that goes along with Swimmer_ID. I
can't seem to get this to work. Suggestions?
 
M

Marshall Barton

Cpierswim said:
Quick version of question:

I have a table with that I want to sort on one columb, and have no
duplicates in the other. I only want the no duplicates in one columb and I
want to sort after the duplicates have been removed. How do I do this?

Longer explination of question:
I'm a swim coach and I have a huge database of times. I'm trying to get the
database to display the best time of each swimmer in order from fastest to
slowest. Here are the columbs that this questions applies to:

1: Swimmer_ID String
2: Time Integer

I want to have no duplicates in Swimmer_ID and I want the fastest time
(lowest number) in the database for Time that goes along with Swimmer_ID. I
can't seem to get this to work.


I believe this will do that:

SELECT SwimmerID, Min([Time]) As BestTime
FROM thetable
GROUP BY SwimmerID
ORDER BY Min([Time])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top