Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL - VFP8 and SetEngineBehavior
Message
De
25/01/2006 14:39:40
 
 
À
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:
01090253
Vues:
11
Since you can't use group by without including all non-aggregate fields in the group by clause, there really isn't a way to do it. But as long as you don't care what the values are of transtype, ibucketid, planid, emp_id, and contrib_dt in the final grouping, you could just aggregate them - ie - Max(transtype), Max(iBucketId) etc.

>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
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform