Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL 1 Parent many children
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
SQL 1 Parent many children
Miscellaneous
Thread ID:
00412522
Message ID:
00412522
Views:
56
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
Next
Reply
Map
View

Click here to load this message in the networking platform