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:
00794919
Vues:
17
Yes, I use 6. And I will try to make a small set of data to duplicate the problem and if the problem is still there (in a small subset of data) I will email it to you. Thank you for your help.

>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.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform