Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with Inner Join
Message
From
25/01/2000 04:15:55
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Help with Inner Join
Miscellaneous
Thread ID:
00322067
Message ID:
00322067
Views:
54
I’m working on a class hierarchy with four levels. The normalized structure is as follows:

C1 n..n C2 1..n C3 n..n C4

Class1 to Class2 is many-to-many, Class2 to Class3 is 1 to many and so on….

What I would like, are items from Class4 based on the selection of the previous classes.
The items that currently appear from Class4 seem to ignore Class1, based on the below select statement.

If someone could point me in the right direction I would be most grateful.

SELECT Class4.item;
FROM Class4;
INNER JOIN C1_C2 ON Class1.C1id = C1_C2.C1id;
INNER JOIN Class2 ON Class2.C2id = C1_C2.C2id;
INNER JOIN Class3 ON Class2.C2id = Class3.C2id;
INNER JOIN C3_C4 ON Class3.C3id = C3_C4.C3id;
INNER JOIN Class4 ON Class4.C4id = C3_C4.C4id;
WHERE Class3.C3id = 1;
AND Class2.C2id = 2;
AND Class1.C1id =3

Sorry if this looks too cryptic.

Peter In-Albon
Next
Reply
Map
View

Click here to load this message in the networking platform