Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select question
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00794895
Message ID:
00794910
Views:
12
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform