Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GROUP BY: missing clause
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01179682
Message ID:
01179700
Views:
13
Jim,
I was wondering: Assuming that the data is known well enough to know that it won't produce ambig results, can you just flip to EB 70 and run the query and then flip EB back to a newer version? Also, if you do this, will the query then run faster by omitting the extra group-by elements? Kind of a concidence that I happen to have some situations like that... i.e., where you don't necessarily need to "group by" all non-aggregated items listed in the select clause in order to get unambiguous results.

For example, if a UserID is always uniquely associated with one MemberName, and you do:

Select UserID, MemberName, Count(*) as NTally Group by UserID

This works with EB70 but not later versions. Sometimes when I'm doing analytics and creating intermediate/derivative tables it seems (superficially at least) easier and faster to work with denormalized data like this.

>>What is wrong with this SELECT statement? I am getting "SQL: GROUP BY clause missing or invalid" error message. Please help... Thanks, Sam
>>
>>
>>SELECT VENID_55, COMNAM_08, SUM(COST_55*TNXQTY_55) AS STDCOST, ;
>>	SUM(ORDCST_55*TNXQTY_55) AS POCOST ;
>>FROM VRSUMINV1 ;
>>GROUP BY VENID_55 ;
>>ORDER BY VENID_55 ;
>>INTO CURSOR VRSUMINV2
>>
>
>In VFP9 a SELECT that has a GROUP BY all fields in the field list must be either aggregate functions or part of the group by clause. Your statement has the field COMNAM_08 listed which is neither an aggregate nor part of the group by.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform