Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select the records which have a max() of a field
Message
From
17/11/2002 23:01:01
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00723707
Message ID:
00723729
Views:
10
>You can do this in two steps
SELECT field1, field2, MAX(field3) AS max3 ;
>  FROM curFirst ;
>  group by Field1, Field2 ;
>  INTO CURSOR crsTemp
>
>SELECT * ;
>	FROM curFirst  ;
>	WHERE STR(Field1) + STR(Field2) + STR(Field3) ;
>		IN ( SELECT STR(Field1) + STR(Field2) + STR(max3)
>				FROM crsTemp );
>	INTO CURSOR crsResult
Which is what I did, in a slightly different manner on the second one, using a join. I thought there was a way to do it in a single select - and it almost worked, except it retrieved partial set of records only.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform