Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group By does not return right result with multiple tabl
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01186807
Message ID:
01187039
Views:
18
>Or:
>
>SELECT Fld1, SUM(Ammount) AS Ammount1;
>       FROM crsTest1;
>GROUP BY Fld1;
>INTO CURSOR cTest1
>
>SELECT Fld1, SUM(Ammount) AS Ammount2;
>       FROM crsTest2;
>GROUP BY Fld1;
>INTO CURSOR cTest2
>
>SELECT crsTest.Fld1,;
>       cTest1.Ammount1,;
>       cTest2.Ammount2;
>FROM crsTest;
>INNER JOIN cTest1 ON crsTest.Fld1 = cTest1.Fld1;
>INNER JOIN cTest2 ON crsTest.Fld1 = cTest2.Fld1
>
You would use LEFT JOIN and it's even more steps <g>
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform