Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OUTER/INNER JOIN Query question
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
OUTER/INNER JOIN Query question
Miscellaneous
Thread ID:
00212448
Message ID:
00212448
Views:
66
I have a 3 table query, which I originally generated with the
VFP Query builder. The original VFP query looks like this:

SELECT parts.whatever, ..., make.whatever , parts_a.whatever;
FROM data1!parts LEFT OUTER JOIN data1!make;
INNER JOIN data1!parts Parts_a ;
ON Make.m_sub_part = Parts_a.p_part_id ;
ON Parts.p_part_id = Make.m_part_id;
ORDER BY Parts.p_part_number;
INTO TABLE parts_b.dbf

I was able to save this query, but since I thought the
INNER JOINs should be next to their respective ONs, and I
thought it was a bug with the VFP query editor, I changed
it to read like this:

SELECT Parts.whatever, make.whatever, parts_a.whatever;
FROM data1!parts LEFT OUTER JOIN data1!make;
ON Parts.p_part_id = Make.m_part_id;
INNER JOIN data1!parts Parts_a ;
ON Make.m_sub_part = Parts_a.p_part_id ;
ORDER BY Parts.p_part_number;
INTO TABLE parts_c.dbf

The results I get are very different. I want a LEFT
OUTER JOIN between parts and make, which I was getting
from my first query, but not from my second query. I
am not sure what I am getting from my second query,
but it does not show all the records from parts, which
is what I would expect from a left outer join.

What am I doing wrong?
Next
Reply
Map
View

Click here to load this message in the networking platform