Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL - VFP8 and SetEngineBehavior
Message
De
25/01/2006 14:40:35
 
 
À
25/01/2006 14:24:50
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01090249
Message ID:
01090254
Vues:
11
Standard SQL requires that when there's a group by, every column either:
a) Be part of a function i.e. Sum, AVG, MAX, etc.
b) Be included in the group by.

Not all your columns that are not SUMMED are part of your group by.

>How can I make the following SQL work under VFP8 without using the SetEngineBehavior command?
>
>
>		INSERT INTO tAcctCont ;
>			(;
>			iTransact, ;
>			transtype, ;
>			Acct_ID, ;
>			econ, ;
>			emat, ;
>			nprofits, ;
>			erforfeit, ;
>			vesteddist, ;
>			othforfeit, ;
>			nprofitsvd, ;
>			totdistrib, ;
>			ibucketid, ;
>			planid, ;
>			empid, ;
>			contrib_dt ;
>			) ;
>			SELECT ;
>			iTransact, ;
>			transtype, ;
>			Acct_ID, ;
>			SUM(econ) AS econ, ;
>			SUM(emat) AS emat, ;
>			SUM(nprofits) AS nprofits, ;
>			SUM(erforfeit) AS erforfeit, ;
>			SUM(vesteddist) AS vesteddist, ;
>			SUM(othforfeit) AS othforfeit, ;
>			SUM(nprofitsvd) AS nprofitsvd, ;
>			SUM(totdistrib) AS totdistrib, ;
>			ibucketid, ;
>			planid, ;
>			empid, ;
>			contrib_dt ;
>			FROM tAcctContTEMP ;
>			GROUP BY 1, 3
>

(On an infant's shirt): Already smarter than Bush
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform