Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Many to Many?
Message
 
 
À
25/09/2000 11:41:30
Criss Jensen
Injury Prevention Research Center
Iowa City, Iowa, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00420303
Message ID:
00420481
Vues:
14
Thinking about it further, I believe the limit is on all JOINS. But as I said, you can write the same thing using WHERE clauses with no limits (except the length of the SQL string itself).

But breaking them up (as David suggested) is probably a better way to go for both readability and performance reasons.

>Thank you both! Boy, was I ever trying to make this really hard.
>
>Another question: Is there a limit on any JOINs or just INNER JOINs? If I have say 20 codes and 3 cities and 2
>EMS companies, etc, etc, etc, I'm probably better off breaking this down to several views first, then joining the views.
>But how much can I put in each view?
>
>>Depending on the number of lookup codes, you may want to change the INNER JOIN syntax to be WHERE clauses. VFP seems to die on queries with 10 or more INNER JOINS.
>>
>>>Criss,
>>>
>>>You can have many tables join to a single codes table. Whenever you use a SELECT statement just use an AS clause on the JOINs to make things easier to read. For example:
>>>
>>>
create sql view windowsview as;
>>>SELECT windows.iID, cWindowLetter,;
>>>  nQuantity, nWidth, nHeight,;
>>>  nCostPerSqFt, nPrice, lNameplate,;
>>>  lProtectiveCovering, lLightbox, lFrames,;
>>>  lFinalMeasurement, ;
>>>  lCircular,;
>>>  CodesStyle.cValue as cWindowStyle, ;
>>>  CodesTop.cValue as cWindowTop ;
>>>  FROM  windows ;
>>>  INNER JOIN codes as CodesStyle;
>>>     ON  windows.iStyle = CodesStyle.iID;
>>>  INNER JOIN codes as CodesTop;
>>>     ON  windows.iTopShape = CodesTop.iID ;
>>> WHERE windows.iProject = ?Projects.iID ;
>>> order by cWindowLetter
>>>
>>>>I have all my system codes in one table. I also have city, county, and state codes in their own tables. Am I setting myself up for major headaches with this? I have a patient table which contains the home address along with multiple system codes for marital status, race, sex, etc. This table is related to an Emergency Dept. visit table with its multiple system codes. The Visit table is related to an Injury table, which has system codes and an address for where the injury took place, and to an EMS table that has the city in which the Emergency Medical Service is located, etc.
>>>>
>>>>Do I need to set up intermediary table for these M -> M relationships or is there a way to get the codes and city, state, etc. names instead of primary keys in views and reports? Any tips are appreciated.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform