Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL SELECT making me crazy! HELP?!?!
Message
De
20/04/2000 00:36:49
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00361642
Message ID:
00361658
Vues:
15
Steve,

>Here's my SELECT command example that doesn't do what I want.

You're not going to be happy until you further normalize your tables. For a lookup table that contains several different types of lookup values, you need essentially three fields (four if you assign a meaningless primary key to each record):
LookType   C   3    LOC, TRN, WHO, EMS, AED, etc. (each set 
                    of records with like values here constitutes
                    one "virtual lookup table"). For example, all 
                    the TRN records are your trainedby lookups
LookCode   C   2    contains the lookup code
LookDesc   C   25   description
Put an index on LookType+LookCode to give you a way to join to each virtual table.

Or, you could separate each type of lookup into individual tables named LookLoc, LookTrn, LookWho, etc and just use LookCode and LookDesc fields with a lookup on LookCode. This second approach would make what you are attempting with the select much easier to accomplish, using OUTER JOINS from the aed.info fields to the LookCode in each table (assuming that you want all records from aed.info with the descriptions from the lookups matching up to the various fields) ... unless I'm totally misunderstanding what you want.
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform