Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT AND AVG()
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00022385
Message ID:
00022471
Views:
54
>Bruce
>I have installed VFP 5.0 and I dont know if you understood me
>in my table I want to retrieve the 3 record with the highest salary.
>For each day it may be 200 records sorted dec. so as an example
>for 3 days I need record no 1-2-3 from day 1
>and record nr 201-202-203 from day 2.
>
>I have tried
>
>SELECT TOP 5 *;
> FROM kuttsnt1;
> ORDER BY dato;
>INTO TABLE pertest
>
>but this does not give me the correct result.
>
Oh, that's a little more complex...this SQL won't work for that. Well, you could do something like index on day+salary desc then loop through and insert the first 3 recs for each day to a cursor, then do SQL grouping by day and getting average there. That should be workable...
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Previous
Reply
Map
View

Click here to load this message in the networking platform