Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group by clause in vfp8
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00774269
Message ID:
00774499
Vues:
38
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform