Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where clause or join
Message
De
22/09/1998 00:13:21
 
 
À
21/09/1998 19:23:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00139283
Message ID:
00139360
Vues:
23
>>>What is the deal between making table joins and just using the where clause to combine information from multiple tables based on common fields. The where clause seems to be extremly faster than the join clause.
>>>
>>>Thanks.
>>
>>Hmm..I've found the opposite to be true. Anyway, JOIN is more ASNI SQL compliant.
>
>
>Maybe I'm not doing this right. I am trying to combine information from 6 tables.
>
>1. torders (1-100 records)
>2. otrack (90 fields 1000s of records)
>3. cardimag (few fields but will retrieve 2 large memo fields for each torder record)
>4. tcolor (tiny)
>5. ucolor (tiny)
>6. clstat (tiny)
>
>torders is the main table. I need all torders fields to be joined with matching otrack fields and cardimag fields. Then out of that set I need all otrack fields with matching tcolor,ucolor,and clstat fields.
>
>Here is what I was trying
>
>SELECT {field names};
> FROM torders JOIN otrack on torders.ship_order+otrack.ship_order;
> JOIN cardimag on torders.id = cardimag.id,;
> otrack JOIN tcolor ON otrack.clr = tcolor.clr;
> JOIN ucolor ON otrack.uclr = ucolor.uclr;
> JOIN clstat ON otrack.status = clstat.status;
> INTO CURSOR tmp
>
>This code makes it sound like my hard drive is getting resurfaced and does not return what I need. Do you see any problems with this code.

The first JOIN has a problem. There is no comparison for torders and otrack.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform