Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Debugging this SQL for the HAVING clause
Message
De
23/06/2006 16:06:04
 
 
À
23/06/2006 14:44:00
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:
01131279
Message ID:
01131303
Vues:
11
This message has been marked as the solution to the initial question of the thread.
>But, if I add an HAVING clause, I have an error on the HAVING clause complaining that it is invalid:
>
>
>SELECT Affiliate.NoMember,SUM(Affiliate.Amount) AS Amount,MAX(Member.Numero) AS Numero,MAX(Member.FirstName) AS FirstName,;
> MAX(Member.LastName) AS LastName;
> FROM Affiliate;
> INNER JOIN Member ON Affiliate.NoMember=Member.Numero;
> WHERE Affiliate.Period<=ldDate AND Affiliate.NoCheque=0;
> GROUP BY NoMember;
> HAVING Amount>100
>
>

Amount is ambiguous here; are you referring to the SUM you just computed or the original Amount field. Try using SUM(Affiliate.Amount) in the HAVING clause instead.

Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform