Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to GROUP BY MAX() ?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00109215
Message ID:
00110587
Views:
24
Thanks Don!
I took your example and reworked it into my table and it works great. I can't say that I completely understand why it works <g>, but I've tested it and it does.

Thanks again for your help - Harold

SELECT MailingListId, ListSelectId, ;
StateCountAsOf, ;
StateCountId ;
FROM StateCount a ;
WHERE A.StateCountAsOf IN ;
(SELECT MAX(StateCountAsOf) ;
FROM StateCount b ;
WHERE b.MailingListId = a.MailingListId ;
AND b.ListSelectId = a.ListSelectId) ;
INTO CURSOR zStateCount

>Hi Harold,
>
>I have what you need... I created a table with the data as supplied by your last example and abbreviated the fields, but will apply with your fields.
>
>
>select a.*;
> from MailData a;
> where a.ml_date in;
> ( select max( b.ml_date );
> from MailData b;
> where b.ml_id = a.ml_id )
>
Harold
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform