Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
This Select Group claims to be Missing or Invalid
Message
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 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01252346
Message ID:
01252375
Vues:
27
>All the non-aggregate fields have to be included in the group by
>
>Just for openers, I don't see CSR_\Discount ( Is that backslash a typo?) or CSR_Percent. ( there are probably more )


Yes, the backslash was a typo (posting late evening was probably a misteak) - it's corrected in the quote below. I'm quite sure that ALL the non-aggregate fields have been included in the GROUP BY with the exception of memo fields which are not allowed, according to the help.


>>The honor of your assistance is requested. I've spent too many hours looking at this SQL-select statement trying to figure out why "The GROUP BY clause is missing or invalid". In the first part, I've added the field type/size at the end of the line. This is generating a cursor for a report.
>>
SELECT Brk_Name, Brk_Address1, Brk_Address2		, ; && C25 C30 C30
>>	CtZ_CityName, CtZ_State, CtZ_PostalCode		, ; && C25 C2 C10
>>	Brk_Contact, Brk_SingleMultiple			, ; && Memo I4
>>	Brk_ShippingRate, Brk_ShippingRules		, ; && Y8.4 Memo
>>	CtV_DisplayOrder, CSR_DisplayOrder		, ; && I4 I4
>>	CtV_StoreName, CSR_CertificateAmount 		, ; && C25 Y8.4
>>	SUM(COr_Amount) AS COr_Amount_SUM		, ; && Y8.4
>>	CSR_Discount, CSR_Percent, CSR_OrgPercent	; && N5.2 N6.2 N6.2
>>FROM ST!CertificateOrder					;
>>	JOIN ST!CertificateSizeRate ON COr_CSRFK==CSR_PK	;
>>	JOIN ST!CertificateVoucher ON CSR_CtVFK==CtV_PK		;
>>	JOIN ST!Broker ON CSR_BrkFK==Brk_PK			;
>>	LEFT JOIN ST!CityZip ON Brk_CtZfk==CtZ_PK		;
>>WHERE COr_OrCFK = '00054'					;
>>ORDER BY Brk_Name, CtV_DisplayOrder, CSR_DisplayOrder		;
>>GROUP BY Brk_SingleMultiple, Brk_Name				, ;
>>	CtV_DisplayOrder, CSR_DisplayOrder			, ;
>>	CtV_StoreName, CSR_CertificateAmount			, ;
>>	CSR_Discount, CSR_Percent, CSR_OrgPercent		, ;
>>	Brk_Address1, Brk_Address2				, ;
>>	CtZ_CityName ,CtZ_State, CtZ_PostalCode, Brk_ShippingRate ;
>>INTO CURSOR rc_OrderTabReport
>>It works as expected without the SUM() and GROUP BY. I've made sure all the non-grouped fields are included and that there are no memo fields in the GROUP BY. Can you see what I've missed?
Randy Bosma
VFP - Because life is too short to code in something else...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform