Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SUM in SQL with two tables, only displaying 1 row ????
Message
De
17/08/2000 21:07:06
 
 
À
17/08/2000 20:37:32
Peter Brama
West Pointe Enterprises
Detroit, Michigan, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00406471
Message ID:
00406475
Vues:
18
>I have the following join SQL:
>
>SELECT Apdetl.*, SUM(Appay.amount);
> FROM acctpro!apdetl LEFT OUTER JOIN acctpro!appay ;
> ON Apdetl.apdetlid = Appay.apdetlid;
> WHERE Apdetl.apmasid = 1.0000;
> ORDER BY Apdetl.ivcdate, Apdetl.ivcnum
>

You have to GROUP BY the fields you currently ORDER BY.
Also, in VFP, the GROUP BY has an implicit ORDER BY, so you don't necessarily need the ORDER BY.
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform