Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fixing SQL statements for VFP8
Message
De
16/06/2004 15:28:02
 
 
À
16/06/2004 15:19:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00914398
Message ID:
00914402
Vues:
10
Beth,

First, you can avoid the issue by setting ENGINEBEHAVIOR TO 70. That way, existing VFP6 queries should run OK in VFP8.

But to answer your question...what this means is that if you're using a GROUP BY, any columns in your SELECT statement that are not aggregated (i.e. SUMMARIZED) must be included in the group by.

So if you had...

SELECT SSN, FirstName, lastname, SUM(checkamt) from GROUP BY SSN

That will not work in VFP8, because all non-aggregate columns (columns you're not summarizing...ssn, firstname, lastname) must be included in the group by...

The correct syntax would be

SELECT SSN, FirstName, lastname, SUM(checkamt) from GROUP BY SSN, FIRSTNAME, LASTNAME

Again, if you SET ENGINEBEHAVIOR TO 70, you don't need to change your queries. Having said that, the 1st example will never work in SQL Server, and I generally recommend coding the same way (just my opinion).

Hope that helps,
Kevin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform