Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select question
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00794895
Message ID:
00794910
Vues:
14
No, I don't see anything wrong. What VFP version are you using, 6? Can you zip up small subset of your data and email to me so I can run some tests?

>Sergey,
>I do have the GROUP BY in my code, I just missed it here in UT message.
>Do you see anything else that might be wrong with my code?
>
>>Hi Dmitry,
>>
>>Your select is missing
GROUP BY PARTS.PART_NO
>>
>>>I am having another problem, which probably stems from my misunderstanding of SQL Select.
>>>
>>>Three tables:
>>>
>>>Table 1: PARTS
>>>Fields: PART_NO, etc.
>>>
>>>Table 2: PO_PARTS (purchased parts)
>>>Fields: PART_NO, POPART_PK, etc.
>>>
>>>Table 3: PARTS_RECEIVED
>>>Fields: POPART_PK, DATE_REC, QTY, etc.
>>>
>>>When I have the following query:
>>>
>>>
>>>select PARTS.PART_NO, sum( PARTS_RECEIVED.QTY ) as SUM_QTY from PARTS ;
>>>left join PO_PARTS on PARTS.PART_NO = PO_PARTS.PART_NO ;
>>>left join PARTS_RECEIVED on PO_PARTS.POPART_PK = PARTS_RECEIVED.POPART_PK
>>>
>>>
>>>I get only those records from PARTS that have entries in PO_PARTS. I thought this SQL Select (because it is left join) would have all records from PARTS table.
>>>
>>>What am I missing?
>>>
>>>TIA.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform