Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL 1 Parent many children
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
SQL 1 Parent many children
Divers
Thread ID:
00412522
Message ID:
00412522
Vues:
55
I have 1 main parent table to many children tables. However, the children are related only to the parent not to each other. That is, there is no grandchild tables. I wanted to put all tables used in to a single SQL like:
SELECT MyParent.* ;
FROM MyParent, MyChild1, MyChild2, MyChild3 ;
INNER JOIN MyChild1 ;
INNER JOIN MyChild2 ; 
INNER JOIN MyChild3 ;
ON MyParent.MyKey = MyChild3.MyKey ;
ON MyParent.MyKey = MyChild2.MyKey ;
ON MyParent.MyKey = MyChild1.MyKey ;
WHERE MyParent.MyField1 = "MyVal" ;
AND MyChild1.MyField = "MyVal" ;
AND MyChild2.MyField = "MyVal" ;
AND MyChild3.MyField = "MyVal"
However SYS(3054,11) shows cartesians are being processed after the first join. Is there any way to join these tables in one SQL statement or do I have to buiild them (or is it more efficient) one table at a time to a preceeding result set?
Thanks
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform