Jump to content

Looking for the best possible query


asmith

Recommended Posts

Hi,

 

I have this table that has recorded the times which each member has done in a sport:

 

ID_MEMBER    ID_SPORT  hisTime

12                32            45.25

14                51            41.52

 

For the member page, I want to run a query to find out if the specified member is being 1st, 2nd or 3rd in EACH ID_SPORT. (kinda like checking to see if he has any medal)

 

Its possible that a member have 2 or more times per ID_SPORT.

 

For example if the member have the 1st and 2nd time of a ID_SPORT he will be counted as 1st (But not second), and the third time will be calculated as 2nd. (If it is by other member)

 

This table's gonna be so big. Over 10, 000 rows.

How can I write the fastest query possible?

 

Thanks for your time 

 

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

it may be like this:

 

ID_MEMBER    ID_SPORT  hisTime

12                32            45.25

12                32            41.52

14                32            46.12

17                32            50.01

 

Member 12 has the 1st and 2nd place. But I just want to count his best time and ignore his other attempts. So member 12 must be counted as 1st, member 14 as 2nd and member 17 as 3rd.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.