Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Model
Message
From
05/10/2000 17:53:21
 
 
To
05/10/2000 13:23:39
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00425414
Message ID:
00425728
Views:
11
Hi Perry,

I guess you missed my joke about T.S. Helene hitting Perry, FLA and the headlines that might come of it? "Helene Blows Perry" :-)

Anyway, this situation looks like it requires a self-join via a join table that defines the "required" relationship. Let say that we have the "options" table:

Parts
pk Part
-----------
11111 Bose receiver
22222 Bose speakers
33333 Bose subwoofer
44444 Ear protectors

Now we have a "requires" table that defines the relationship

Requires
pk fkpart fkrequires
----------------------
123456 11111 22222 A bose receiver requires bose speakers
123457 11111 33333 Also requires a bose subwoofer

See?
SELECT * FROM parts   (All parts)
SELECT * FROM requires INNER JOIN parts ON requires.fkrequires =  parts.pk ;
  WHERE requires.fkpart = ?parts.pk  (all required parts for current part)
It gets more complicated if you have a required part with a required part, but it's doable. Feel free to email me about this; I just worked on a similar project.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Reply
Map
View

Click here to load this message in the networking platform