General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
OUTER/INNER JOIN Query question
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only