Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group by clause in vfp8
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00774269
Message ID:
00774499
Views:
39
SELECT sku, stockcolor, SUM(quantity);
  FROM Products;
  GROUP BY sku;
  INTO CURSOR resultset
George,

In the above select the stockcolor has an undefined value as any one sku may have many colors or not. Becuase the stockcolor is not in the group by the sql interpreter cannot guarantee that the value of stockcolor will be a valid or exepcted value. Valid SQL would either drop the stockcolor field from the query or include it in the group by clause.

Just about every other SQL product will disallow that syntax. Try that query in SQL Server's Query analyzer, and there you have no option to change the behavior. We have been spoiled because VFP has allowed invlaid sql in the past and now in VFP8 we can turn on a checker that will disallow the invalid SQL statements.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform