Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SUM in SQL with two tables, only displaying 1 row ????
Message
From
17/08/2000 21:07:06
 
 
To
17/08/2000 20:37:32
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00406471
Message ID:
00406475
Views:
17
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform