Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group By does not return right result with multiple tabl
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 8 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01186807
Message ID:
01187050
Vues:
47
>>>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>
>
>Why? The steps are the same, just you must use
>NVL(cTest1.Ammount1, 000000.00) AS Amount1,;

I meant you're using 3 selects, which is greater than 2. <g>
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