Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GROUP BY overkill
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
Divers
Thread ID:
01248447
Message ID:
01248483
Vues:
26
This message has been marked as the solution to the initial question of the thread.
I think the UDF is messing you up. I see that Sergey already provided a plan to work it out.

Check also Re: If found() Thread #1247979 Message #1248018 for a sample.

>Hi all
>
>I have the below select statement. Except for the first 2 fields in the GROUP BY none of them are necessary, of course I can change the ENGINEBEHAVIOR and get the query to run without the additional field. In any case I have listed all the TPATIENTS fields and the other fields that are in the SELECT statement, yet I am getting the message that the GROUP BY is missing or invalid. I have tried to remove the mAddress field (being a memo field) but no joy. Can someone spot what I am missing.
>
>Thanks.
>
>
SELECT TPATIENTS.*, ;
>		SPATIENTS.ISRNO, ;
>		MTESTTYPES.CTYPE, ;
>		SPATIENTS.IID, ;
>		MDOCTORS.CNAME, ;
>		SUM(SPATIENTS.YRATE) AS YRATE, ;
>		CLUBTESTNAMES(SPATIENTS.IPID, MTESTS.ITYPE) AS CTEST ;
>	FROM VSO3!TPATIENTS ;
>		inner join VSO3!SPATIENTS on SPATIENTS.IPID = TPATIENTS.IID ;
>		inner join VSO3!MTESTS on SPATIENTS.ITEST = MTESTS.IID ;
>		inner join VSO3!MTESTTYPES ON MTESTS.ITYPE = MTESTTYPES.IID ;
>		inner join VSO3!MDOCTORS ON TPATIENTS.IREFDOC = MDOCTORS.IID ;
>	GROUP BY SPATIENTS.IPID, MTESTTYPES.IID, ;
>		SPATIENTS.ISRNO, ;
>		MTESTTYPES.CTYPE, ;
>		SPATIENTS.IID, ;
>		MDOCTORS.CNAME, ;
>		TPATIENTS.IID, ;
>		TPATIENTS.iPID, ;
>		TPATIENTS.ddt, ;
>		TPATIENTS.ino, ;
>		TPATIENTS.cname, ;
>		TPATIENTS.nage, ;
>		TPATIENTS.ndays, ;
>		TPATIENTS.cgender, ;
>		TPATIENTS.irefdoc, ;
>		TPATIENTS.maddress, ;
>		TPATIENTS.idrreqno ;
>	ORDER BY TPATIENTS.DDT, TPATIENTS.INO
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform