Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data Model
Message
De
05/10/2000 17:53:21
 
 
À
05/10/2000 13:23:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00425414
Message ID:
00425728
Vues:
10
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform