Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECTing MAX()
Message
From
13/12/2000 11:15:46
 
 
To
12/12/2000 21:18:06
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00452686
Message ID:
00452870
Views:
17
>What would be the best way to do this in a SELECT statment?
>I have a table with scores. Each person may have more than one score but I need to select only the highest for EACH person.
>
>I am not sure how to do it in a subquery. I tried something like this but of course is not good:
>SELECT * FROM myCur WHERE id = id;
>AND score IN ;
> (SELECT MAX(score) FROM myCur)
>
>thanks in advance

How about this - assuming that id and score are numeric fields
select * from mycur ;
  where transform(id)+transform(score) in ;
   (select transform(id)+transform(max(score)) from myCur group by id)
Insanity: Doing the same thing over and over and expecting different results.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform