Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL group by syntax
Message
 
To
21/09/1996 18:03:44
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00008348
Message ID:
00008417
Views:
31
>>Or, I can use step 1 and SELECT from that cursor in step 2.
>
>Here's what I did.
>
>SELECT NOCLIENT,DATE FROM TABLE ORDER BY DATE INTO CURSOR TEMP
>
>SELECT * FROM TEMP GROUP BY NOCLIENT INTO CURSOR TEMP2
>
>First select to get all by ascending date. Then, on the 2nd select, the group will only the last occurence which will represent the last date.
>
>Thanks for your suggestions.

Essentially what you've done here is a 'nested' SELECT SQL statement. I don't know if VFP directly supports it, but I think some SQL RDBMSes do.

Though I may be beating a dead horse, isn't the ff. the same thing you're trying to do?

SELECT NOCLIENT, MAX(DATE) FROM TABLE GROUP BY NOCLIENT
alistair israel
Distressed DBA, Sleepy SysAd, Weary WebMaster (aka Senior Software Engineer)
aisrael@poboxes.com
Makati City, Philippines
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform