Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OUTER/INNER JOIN Query question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
OUTER/INNER JOIN Query question
Divers
Thread ID:
00212448
Message ID:
00212448
Vues:
67
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?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform